From 4017b5a9f67e06145129d75de452c8a42e2d2f5a Mon Sep 17 00:00:00 2001 From: Laurenz Date: Fri, 11 Jun 2021 14:42:20 +0200 Subject: Push some nodes directly into the stack --- src/layout/mod.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/layout/mod.rs') 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, /// The final region that is repeated once the backlog is drained. pub last: Option, - /// 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, + pub expand: Spec, } impl Regions { /// Create a new region sequence with exactly one region. - pub fn one(size: Size, fixed: Spec) -> Self { + pub fn one(size: Size, expand: Spec) -> 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) -> Self { + pub fn repeat(size: Size, expand: Spec) -> 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, } } -- cgit v1.2.3