diff options
| author | Laurenz <laurmaedje@gmail.com> | 2019-10-13 12:36:45 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2019-10-13 12:36:45 +0200 |
| commit | e2d17aa9d9491b339e6200c97b52f7ade51fa1d8 (patch) | |
| tree | 95dfa729cc6cbe44ecbf5135f87a3dd8bb70200a /src/library/align.rs | |
| parent | 463e4ebd8234da5e28700e9b22b6ef5f0dfef56f (diff) | |
Move functions to command-based architecture ✈
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") } |
