diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-06-11 14:42:20 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-06-11 14:42:20 +0200 |
| commit | 4017b5a9f67e06145129d75de452c8a42e2d2f5a (patch) | |
| tree | 8ce9c6f80faa75ed62d4f7fbe31d3ceee6e8d4ba /src/layout/mod.rs | |
| parent | 4dbd9285c91d59d527f4324df4aaf239ecb007ca (diff) | |
Push some nodes directly into the stack
Diffstat (limited to 'src/layout/mod.rs')
| -rw-r--r-- | src/layout/mod.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 9d8549e6..4153fc3c 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -64,8 +64,8 @@ impl PageRun { // When one of the lengths is infinite the page fits its content along // that axis. let Size { width, height } = self.size; - let fixed = Spec::new(width.is_finite(), height.is_finite()); - let regions = Regions::repeat(self.size, fixed); + let expand = Spec::new(width.is_finite(), height.is_finite()); + let regions = Regions::repeat(self.size, expand); self.child.layout(ctx, ®ions) } } @@ -214,34 +214,34 @@ pub struct Regions { pub backlog: Vec<Size>, /// The final region that is repeated once the backlog is drained. pub last: Option<Size>, - /// Whether layouting into these regions should produce frames of the exact - /// size of `current` instead of shrinking to fit the content. + /// Whether nodes should expand to fill the regions instead of shrinking to + /// fit the content. /// /// This property is only handled by nodes that have the ability to control /// their own size. - pub fixed: Spec<bool>, + pub expand: Spec<bool>, } impl Regions { /// Create a new region sequence with exactly one region. - pub fn one(size: Size, fixed: Spec<bool>) -> Self { + pub fn one(size: Size, expand: Spec<bool>) -> Self { Self { current: size, base: size, backlog: vec![], last: None, - fixed, + expand, } } /// Create a new sequence of same-size regions that repeats indefinitely. - pub fn repeat(size: Size, fixed: Spec<bool>) -> Self { + pub fn repeat(size: Size, expand: Spec<bool>) -> Self { Self { current: size, base: size, backlog: vec![], last: Some(size), - fixed, + expand, } } @@ -255,7 +255,7 @@ impl Regions { base: f(self.base), backlog: self.backlog.iter().copied().map(|s| f(s)).collect(), last: self.last.map(f), - fixed: self.fixed, + expand: self.expand, } } |
