diff options
| author | Laurenz <laurmaedje@gmail.com> | 2019-12-09 13:29:04 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2019-12-09 13:29:04 +0100 |
| commit | 7e980224354880cfda1797136a1ff886d6642662 (patch) | |
| tree | c0137dcca82526faa71fd1d980a90c68dac798c8 /src/library/boxed.rs | |
| parent | 64f938b449b7ff5e53b6a06ed943bf9dedc1014b (diff) | |
Bad stack layouter 🚑
Diffstat (limited to 'src/library/boxed.rs')
| -rw-r--r-- | src/library/boxed.rs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/library/boxed.rs b/src/library/boxed.rs index 3ec9d001..d3d5b591 100644 --- a/src/library/boxed.rs +++ b/src/library/boxed.rs @@ -6,7 +6,7 @@ function! { #[derive(Debug, PartialEq)] pub struct Boxed { body: SyntaxTree, - map: ExtentMap, + map: ExtentMap<PSize>, } parse(args, body, ctx) { @@ -17,7 +17,18 @@ function! { } layout(self, mut ctx) { - self.map.apply(ctx.axes, &mut ctx.spaces[0].dimensions)?; + use SpecificAxisKind::*; + + let space = &mut ctx.spaces[0]; + self.map.apply_with(ctx.axes, |axis, p| { + let entity = match axis { + Horizontal => { space.expand.0 = true; &mut space.dimensions.x }, + Vertical => { space.expand.1 = true; &mut space.dimensions.y }, + }; + + *entity = p.concretize(*entity) + }); + vec![AddMultiple(layout_tree(&self.body, ctx)?)] } } |
