summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2019-11-15 13:05:25 +0100
committerLaurenz <laurmaedje@gmail.com>2019-11-15 13:05:25 +0100
commit9473ae61e9cfc419eb6b48fb0ed15441cc7ad48b (patch)
treeda7f23a8a653b41b5395a4756f1ee0472f5b35e0 /src/lib.rs
parent40c879e3c03794a52cabcf31dc4216afc53c6ec5 (diff)
Generalize stack layouter 🎲
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index c6dfb132..21d8b3c0 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -21,7 +21,8 @@ use toddle::query::{FontLoader, FontProvider, SharedFontLoader};
use crate::func::Scope;
use crate::layout::{layout_tree, LayoutContext, MultiLayout};
-use crate::layout::{Alignment, Flow, LayoutError, LayoutResult, LayoutSpace};
+use crate::layout::{LayoutAxes, AlignedAxis, Axis, Alignment};
+use crate::layout::{LayoutError, LayoutResult, LayoutSpace};
use crate::syntax::{SyntaxTree, parse, ParseContext, ParseError, ParseResult};
use crate::style::{PageStyle, TextStyle};
@@ -102,11 +103,13 @@ impl<'p> Typesetter<'p> {
LayoutContext {
loader: &self.loader,
style: &self.text_style,
- alignment: Alignment::Left,
- flow: Flow::Vertical,
space,
followup_spaces: Some(space),
shrink_to_fit: false,
+ axes: LayoutAxes {
+ primary: AlignedAxis::new(Axis::LeftToRight, Alignment::Left).unwrap(),
+ secondary: AlignedAxis::new(Axis::TopToBottom, Alignment::Top).unwrap(),
+ },
},
)?;