diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-07-29 18:09:51 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-07-29 18:09:51 +0200 |
| commit | bbcdeb128cce04cd95714b7bc7af5a23a7e38bd2 (patch) | |
| tree | e0a1620d335982669cd7671cbd71df46d100e9ea /src/layout/model.rs | |
| parent | f34ba3dcda182d9b9c14cc94fdb48810bf18bef0 (diff) | |
Move, rename and switch some things (boring) 🚚
- Problems -> Diagnostics
- Position -> Pos
- offset_spans -> Offset trait
- Size -> Length (and some more size types renamed)
- Paper into its own module
- scope::Parser -> parsing::CallParser
- Create `Decorations` alias
- Remove lots of double newlines
- Switch from f32 to f64
Diffstat (limited to 'src/layout/model.rs')
| -rw-r--r-- | src/layout/model.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/layout/model.rs b/src/layout/model.rs index 91d21037..a15598d2 100644 --- a/src/layout/model.rs +++ b/src/layout/model.rs @@ -10,14 +10,13 @@ use toddle::query::FontStyle; use crate::{Pass, Feedback}; use crate::GlobalFontLoader; use crate::style::{LayoutStyle, PageStyle, TextStyle}; -use crate::size::{Size, Size2D}; +use crate::length::{Length, Size}; use crate::syntax::{Model, SyntaxModel, Node, Decoration}; use crate::syntax::span::{Span, Spanned}; use super::line::{LineLayouter, LineContext}; use super::text::{layout_text, TextContext}; use super::*; - /// Performs the model layouting. #[derive(Debug)] pub struct ModelLayouter<'a> { @@ -36,7 +35,7 @@ pub struct LayoutContext<'a> { /// The style for pages and text. pub style: &'a LayoutStyle, /// The base unpadded dimensions of this container (for relative sizing). - pub base: Size2D, + pub base: Size, /// The spaces to layout in. pub spaces: LayoutSpaces, /// Whether to have repeated spaces or to use only the first and only once. @@ -76,7 +75,7 @@ pub enum Command<'a> { /// Add spacing of given [kind](super::SpacingKind) along the primary or /// secondary axis. The spacing kind defines how the spacing interacts with /// surrounding spacing. - AddSpacing(Size, SpacingKind, GenericAxis), + AddSpacing(Length, SpacingKind, GenericAxis), /// Start a new line. BreakLine, @@ -159,7 +158,7 @@ impl<'a> ModelLayouter<'a> { for Spanned { v: node, span } in &model.nodes { let decorate = |this: &mut ModelLayouter, deco| { - this.feedback.decos.push(Spanned::new(deco, *span)); + this.feedback.decorations.push(Spanned::new(deco, *span)); }; match node { |
