diff options
| author | Laurenz <laurmaedje@gmail.com> | 2019-12-12 23:33:26 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2019-12-12 23:33:26 +0100 |
| commit | f549914ff8d66e48e779d4d99898a224bd1ab701 (patch) | |
| tree | 12dddf9feb18a39bc05aa69fe8d9b5eac802dfaf /src/layout/tree.rs | |
| parent | ff107cf3e75acf041f8b7631337d299cdeaa1685 (diff) | |
Refine and rename layouting types 🛀
Diffstat (limited to 'src/layout/tree.rs')
| -rw-r--r-- | src/layout/tree.rs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/layout/tree.rs b/src/layout/tree.rs index 9c909d9c..e9d8850d 100644 --- a/src/layout/tree.rs +++ b/src/layout/tree.rs @@ -76,13 +76,10 @@ impl<'a, 'p> TreeLayouter<'a, 'p> { } fn layout_func(&mut self, func: &FuncCall) -> LayoutResult<()> { - let spaces = self.stack.remaining(); - let commands = func.0.layout(LayoutContext { - loader: self.ctx.loader, style: &self.style, - spaces, - top_level: false, + spaces: self.stack.remaining(), + nested: true, debug: true, .. self.ctx })?; @@ -103,8 +100,8 @@ impl<'a, 'p> TreeLayouter<'a, 'p> { Add(layout) => self.stack.add(layout)?, AddMultiple(layouts) => self.stack.add_multiple(layouts)?, AddSpacing(space, kind, axis) => match axis { - GenericAxisKind::Primary => {}, - GenericAxisKind::Secondary => self.stack.add_spacing(space, kind), + Primary => {}, + Secondary => self.stack.add_spacing(space, kind), } FinishLine => {}, @@ -114,8 +111,8 @@ impl<'a, 'p> TreeLayouter<'a, 'p> { SetTextStyle(style) => self.style.text = style, SetPageStyle(style) => { - if !self.ctx.top_level { - error!("the page style cannot only be altered from a top-level context"); + if self.ctx.nested { + error!("page style cannot be altered in nested context"); } self.style.page = style; @@ -123,7 +120,7 @@ impl<'a, 'p> TreeLayouter<'a, 'p> { LayoutSpace { dimensions: style.dimensions, padding: style.margins, - expand: LayoutExpansion::new(true, true), + expansion: LayoutExpansion::new(true, true), } ], true); } |
