From bbcdeb128cce04cd95714b7bc7af5a23a7e38bd2 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 29 Jul 2020 18:09:51 +0200 Subject: =?UTF-8?q?Move,=20rename=20and=20switch=20some=20things=20(boring?= =?UTF-8?q?)=20=F0=9F=9A=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- src/layout/model.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/layout/model.rs') 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 { -- cgit v1.2.3