diff options
| author | Laurenz <laurmaedje@gmail.com> | 2019-11-15 13:05:25 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2019-11-15 13:05:25 +0100 |
| commit | 9473ae61e9cfc419eb6b48fb0ed15441cc7ad48b (patch) | |
| tree | da7f23a8a653b41b5395a4756f1ee0472f5b35e0 /src/lib.rs | |
| parent | 40c879e3c03794a52cabcf31dc4216afc53c6ec5 (diff) | |
Generalize stack layouter 🎲
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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(), + }, }, )?; |
