summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2019-12-11 22:06:54 +0100
committerLaurenz <laurmaedje@gmail.com>2019-12-11 22:06:54 +0100
commita791ef162868c65284903ab479731e0dc9e7a223 (patch)
tree28384c5647086db87c822b186860492dfce23af3 /src/library
parentd34707a6ae058560140c83af21365884451e9274 (diff)
Pretty good stack layouter ✈
Diffstat (limited to 'src/library')
-rw-r--r--src/library/boxed.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/library/boxed.rs b/src/library/boxed.rs
index 7c0ea0c6..0428e746 100644
--- a/src/library/boxed.rs
+++ b/src/library/boxed.rs
@@ -7,19 +7,25 @@ function! {
pub struct Boxed {
body: SyntaxTree,
map: ExtentMap<PSize>,
+ debug: bool,
}
parse(args, body, ctx) {
Boxed {
body: parse!(optional: body, ctx).unwrap_or(SyntaxTree::new()),
map: ExtentMap::new(&mut args, false)?,
+ debug: args.get_key_opt::<bool>("debug")?
+ .map(Spanned::value)
+ .unwrap_or(true),
}
}
layout(self, mut ctx) {
use SpecificAxisKind::*;
+ ctx.debug = self.debug;
let space = &mut ctx.spaces[0];
+
self.map.apply_with(ctx.axes, |axis, p| {
let entity = match axis {
Horizontal => { space.expand.horizontal = true; &mut space.dimensions.x },
@@ -27,7 +33,7 @@ function! {
};
*entity = p.concretize(*entity)
- });
+ })?;
vec![AddMultiple(layout_tree(&self.body, ctx)?)]
}