diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-10-03 15:07:57 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-10-03 15:07:57 +0200 |
| commit | 95bae5725cf6495644e2593f8492f1cd0e5bd3c1 (patch) | |
| tree | 919dd90cac7623bcbbc09d9c92399eaa65e537f2 /src/library/boxed.rs | |
| parent | 0fc25d732d7cbc37cf801645849d1060f2cec4a3 (diff) | |
Int, Float, Relative and Linear values 🍉
Diffstat (limited to 'src/library/boxed.rs')
| -rw-r--r-- | src/library/boxed.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/library/boxed.rs b/src/library/boxed.rs index ac0bc19e..b36a151b 100644 --- a/src/library/boxed.rs +++ b/src/library/boxed.rs @@ -1,5 +1,5 @@ use super::*; -use crate::length::ScaleLength; +use crate::geom::Linear; /// `box`: Layouts its contents into a box. /// @@ -19,17 +19,17 @@ pub async fn boxed( ctx.spaces.truncate(1); ctx.repeat = false; - if let Some(width) = args.take_key::<ScaleLength>("width", &mut f) { - let length = width.raw_scaled(ctx.base.width); - ctx.base.width = length; - ctx.spaces[0].size.width = length; + if let Some(width) = args.take_key::<Linear>("width", &mut f) { + let abs = width.eval(ctx.base.width); + ctx.base.width = abs; + ctx.spaces[0].size.width = abs; ctx.spaces[0].expansion.horizontal = true; } - if let Some(height) = args.take_key::<ScaleLength>("height", &mut f) { - let length = height.raw_scaled(ctx.base.height); - ctx.base.height = length; - ctx.spaces[0].size.height = length; + if let Some(height) = args.take_key::<Linear>("height", &mut f) { + let abs = height.eval(ctx.base.height); + ctx.base.height = abs; + ctx.spaces[0].size.height = abs; ctx.spaces[0].expansion.vertical = true; } |
