diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-04-08 15:08:26 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-04-08 15:45:14 +0200 |
| commit | 712c00ecb72b67da2c0788e5d3eb4dcc6366b2a7 (patch) | |
| tree | f5d7ef4341a4728c980d020cc173fa6bb70feaff /src/library/layout/columns.rs | |
| parent | 977ac77e6a3298be2644a8231e93acbef9f7f396 (diff) | |
Em units
Diffstat (limited to 'src/library/layout/columns.rs')
| -rw-r--r-- | src/library/layout/columns.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/library/layout/columns.rs b/src/library/layout/columns.rs index 1cb45c37..3ef66b40 100644 --- a/src/library/layout/columns.rs +++ b/src/library/layout/columns.rs @@ -14,7 +14,8 @@ pub struct ColumnsNode { #[node] impl ColumnsNode { /// The size of the gutter space between each column. - pub const GUTTER: Relative<Length> = Ratio::new(0.04).into(); + #[property(resolve)] + pub const GUTTER: Relative<RawLength> = Ratio::new(0.04).into(); fn construct(_: &mut Context, args: &mut Args) -> TypResult<Content> { Ok(Content::block(Self { @@ -39,7 +40,7 @@ impl Layout for ColumnsNode { // Determine the width of the gutter and each column. let columns = self.columns.get(); - let gutter = styles.get(Self::GUTTER).resolve(regions.base.x); + let gutter = styles.get(Self::GUTTER).relative_to(regions.base.x); let width = (regions.first.x - gutter * (columns - 1) as f64) / columns as f64; // Create the pod regions. |
