From a93b1ab003affb0d72e9da4007b04a2a6cfd4462 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 6 Jan 2020 12:50:20 +0100 Subject: =?UTF-8?q?Formatting=20=F0=9F=9B=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/actions.rs | 1 + src/layout/line.rs | 3 ++- src/layout/mod.rs | 1 + src/layout/stack.rs | 1 + src/layout/text.rs | 1 + src/layout/tree.rs | 3 +-- 6 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/layout') diff --git a/src/layout/actions.rs b/src/layout/actions.rs index 4ab9fdb1..1bf5d684 100644 --- a/src/layout/actions.rs +++ b/src/layout/actions.rs @@ -6,6 +6,7 @@ use toddle::query::FontIndex; use super::*; use LayoutAction::*; + /// A layouting action. #[derive(Clone)] pub enum LayoutAction { diff --git a/src/layout/line.rs b/src/layout/line.rs index 8f487319..c4205e81 100644 --- a/src/layout/line.rs +++ b/src/layout/line.rs @@ -1,5 +1,6 @@ use super::*; + /// The line layouter arranges boxes next to each other along a primary axis /// and arranges the resulting lines using an underlying stack layouter. #[derive(Debug, Clone)] @@ -181,7 +182,7 @@ impl LineLayouter { /// Finish the run and add secondary spacing to the underlying stack. pub fn add_secondary_spacing( &mut self, - mut spacing: Size, + spacing: Size, kind: SpacingKind ) -> LayoutResult<()> { self.finish_line_if_not_empty()?; diff --git a/src/layout/mod.rs b/src/layout/mod.rs index be1ed43c..49551945 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -39,6 +39,7 @@ pub use self::actions::{LayoutAction, LayoutActions}; pub use self::layouters::*; pub use self::prelude::*; + /// The result type for layouting. pub type LayoutResult = crate::TypesetResult; diff --git a/src/layout/stack.rs b/src/layout/stack.rs index e0562672..80d57424 100644 --- a/src/layout/stack.rs +++ b/src/layout/stack.rs @@ -2,6 +2,7 @@ use smallvec::smallvec; use crate::size::ValueBox; use super::*; + /// The stack layouter stack boxes onto each other along the secondary layouting /// axis. #[derive(Debug, Clone)] diff --git a/src/layout/text.rs b/src/layout/text.rs index 2fdb3f6d..a66e04a2 100644 --- a/src/layout/text.rs +++ b/src/layout/text.rs @@ -5,6 +5,7 @@ use crate::size::{Size, Size2D}; use crate::style::TextStyle; use super::*; + /// The context for text layouting. /// /// See [`LayoutContext`] for details about the fields. diff --git a/src/layout/tree.rs b/src/layout/tree.rs index f645a35d..238c45fc 100644 --- a/src/layout/tree.rs +++ b/src/layout/tree.rs @@ -4,7 +4,6 @@ use smallvec::smallvec; use crate::func::Command; use crate::syntax::{SyntaxTree, Node, FuncCall}; -use crate::style::TextStyle; use super::*; @@ -148,7 +147,7 @@ impl<'a, 'p> TreeLayouter<'a, 'p> { } SetAlignment(alignment) => self.ctx.alignment = alignment, SetAxes(axes) => { - self.layouter.set_axes(axes); + self.layouter.set_axes(axes)?; self.ctx.axes = axes; } } -- cgit v1.2.3