diff options
| author | Martin Haug <mhaug@live.de> | 2022-05-02 18:48:32 +0200 |
|---|---|---|
| committer | Martin Haug <mhaug@live.de> | 2022-05-02 18:48:32 +0200 |
| commit | 33213abe7dfcb8d8065faadd2f5b72ec4b718af1 (patch) | |
| tree | 6763bcd9e8b50e3dcce4e08216127c3c8a492648 /src/model | |
| parent | 9b4397cdab25daff448cefb179a4699f64fa3d3f (diff) | |
New page margins API
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/styles.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/model/styles.rs b/src/model/styles.rs index 00d1df0f..1fddfd0e 100644 --- a/src/model/styles.rs +++ b/src/model/styles.rs @@ -7,7 +7,7 @@ use std::sync::Arc; use super::{Content, Show, ShowNode}; use crate::diag::{At, TypResult}; -use crate::eval::{Args, Func, Node, Smart, Value}; +use crate::eval::{Args, Func, Node, RawLength, Smart, Value}; use crate::geom::{Length, Numeric, Relative, Sides, Spec}; use crate::library::layout::PageNode; use crate::library::structure::{EnumNode, ListNode}; @@ -488,6 +488,19 @@ impl Fold for Sides<Option<Relative<Length>>> { } } +impl Fold for Sides<Smart<Relative<RawLength>>> { + type Output = Sides<Smart<Relative<RawLength>>>; + + fn fold(self, outer: Self::Output) -> Self::Output { + Sides { + left: self.left.or(outer.left), + top: self.top.or(outer.top), + right: self.right.or(outer.right), + bottom: self.bottom.or(outer.bottom), + } + } +} + /// A scoped property barrier. /// /// Barriers interact with [scoped](StyleMap::scoped) styles: A scoped style |
