diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-01-13 23:19:44 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-01-13 23:19:44 +0100 |
| commit | 272a4c228976466e9fa6cc100ad89f93dc5cc371 (patch) | |
| tree | ad02a6e57b07da061432d58ff0ca46d6777bdb97 /src/eval/state.rs | |
| parent | 1b53e27f270e3c040ee095573af9a5243980191a (diff) | |
Unbounded pages 🌌
Diffstat (limited to 'src/eval/state.rs')
| -rw-r--r-- | src/eval/state.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/eval/state.rs b/src/eval/state.rs index 2a8ee2f0..ce6bd009 100644 --- a/src/eval/state.rs +++ b/src/eval/state.rs @@ -4,8 +4,9 @@ use fontdock::{fallback, FallbackTree, FontStretch, FontStyle, FontVariant, Font use super::Scope; use crate::geom::{ - Align, ChildAlign, Dir, LayoutDirs, Length, Linear, Relative, Sides, Size, + Align, ChildAlign, Dir, LayoutDirs, Length, Linear, Relative, Sides, Size, Spec, }; +use crate::layout::Expansion; use crate::paper::{Paper, PaperClass, PAPER_A4}; /// The evaluation state. @@ -45,6 +46,8 @@ pub struct StatePage { pub class: PaperClass, /// The width and height of the page. pub size: Size, + /// Whether the expand the pages to the `size` or to fit the content. + pub expand: Spec<Expansion>, /// The amount of white space in the order [left, top, right, bottom]. If a /// side is set to `None`, the default for the paper class is used. pub margins: Sides<Option<Linear>>, @@ -56,6 +59,7 @@ impl StatePage { Self { class: paper.class, size: paper.size(), + expand: Spec::uniform(Expansion::Fill), margins: Sides::uniform(None), } } |
