From f8233a4cb149c1a69ca3ecc954d45edcd064851b Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 18 Nov 2019 19:36:50 +0100 Subject: =?UTF-8?q?Refactor=20stack=20layouter=20to=20layout=20eagerly=20?= =?UTF-8?q?=F0=9F=9B=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/flex.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/layout/flex.rs') diff --git a/src/layout/flex.rs b/src/layout/flex.rs index 142530a6..e61e45df 100644 --- a/src/layout/flex.rs +++ b/src/layout/flex.rs @@ -76,7 +76,7 @@ impl FlexLayouter { shrink_to_fit: ctx.shrink_to_fit, }); - let usable = stack.usable().x; + let usable = stack.primary_usable(); FlexLayouter { axes: ctx.axes, flex_spacing: ctx.flex_spacing, @@ -134,7 +134,7 @@ impl FlexLayouter { pub fn set_spaces(&mut self, spaces: LayoutSpaces, replace_empty: bool) { if replace_empty && self.box_is_empty() && self.stack.space_is_empty() { self.stack.set_spaces(spaces, true); - self.total_usable = self.stack.usable().x; + self.total_usable = self.stack.primary_usable(); self.usable = self.total_usable; self.space = None; } else { @@ -147,7 +147,7 @@ impl FlexLayouter { /// The layouter is not consumed by this to prevent ownership problems /// with borrowed layouters. The state of the layouter is not reset. /// Therefore, it should not be further used after calling `finish`. - pub fn finish(&mut self) -> LayoutResult { + pub fn finish(mut self) -> LayoutResult { self.finish_box()?; Ok(self.stack.finish()) } @@ -204,7 +204,7 @@ impl FlexLayouter { } self.stack.finish_layout(true); - self.total_usable = self.stack.usable().x; + self.total_usable = self.stack.primary_usable(); self.usable = self.total_usable; } } -- cgit v1.2.3