summaryrefslogtreecommitdiff
path: root/src/library/boxed.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-10-11 22:38:30 +0200
committerLaurenz <laurmaedje@gmail.com>2020-10-11 22:38:30 +0200
commitd3bc4ec07349a96c3863ddce63c2e52b5e7e9f2f (patch)
tree09c582973b58f05f9248d88f0020bf1dda262aa5 /src/library/boxed.rs
parentf04ad0ffa5f34bb7fd97e5c94c7547f96904220c (diff)
Refactor layouting base 🪁
Diffstat (limited to 'src/library/boxed.rs')
-rw-r--r--src/library/boxed.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/library/boxed.rs b/src/library/boxed.rs
index 0c1ed30a..0045b0bd 100644
--- a/src/library/boxed.rs
+++ b/src/library/boxed.rs
@@ -1,5 +1,5 @@
use crate::geom::Linear;
-use crate::layout::{Fixed, Stack};
+use crate::layout::{Expansion, Fixed, Stack};
use crate::prelude::*;
/// `box`: Layouts its contents into a box.
@@ -20,9 +20,7 @@ pub fn boxed(mut args: Args, ctx: &mut EvalContext) -> Value {
ctx.start_group(());
ctx.start_par_group();
-
body.eval(ctx);
-
ctx.end_par_group();
let ((), children) = ctx.end_group();
@@ -33,7 +31,11 @@ pub fn boxed(mut args: Args, ctx: &mut EvalContext) -> Value {
dirs,
children,
aligns,
- expand: Spec::new(width.is_some(), height.is_some()),
+ expansion: Spec::new(
+ Expansion::fill_if(width.is_some()),
+ Expansion::fill_if(height.is_some()),
+ )
+ .switch(dirs),
}),
});