diff options
Diffstat (limited to 'src/library/align.rs')
| -rw-r--r-- | src/library/align.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/library/align.rs b/src/library/align.rs index b1e41abb..099daf88 100644 --- a/src/library/align.rs +++ b/src/library/align.rs @@ -38,13 +38,15 @@ impl Function for AlignFunc { Ok(AlignFunc { alignment, body }) } - fn layout(&self, ctx: LayoutContext) -> LayoutResult<FuncCommands> { + fn layout(&self, mut ctx: LayoutContext) -> LayoutResult<FuncCommands> { if let Some(body) = &self.body { - // // Override the previous alignment and do the layouting. - // ctx.space.alignment = self.alignment; - // layout(body, ctx) - // .map(|l| Some(Layout::Boxed(l))) - Ok(FuncCommands::new()) + ctx.space.alignment = self.alignment; + let layouts = layout_tree(body, ctx)?; + + let mut commands = FuncCommands::new(); + commands.add(Command::AddMany(layouts)); + + Ok(commands) } else { unimplemented!("context-modifying align func") } |
