From e34d06ac13dd1d844054136632c8c1f84541df50 Mon Sep 17 00:00:00 2001 From: Jonathan Johnson Date: Sat, 14 Sep 2024 08:07:32 -0700 Subject: [PATCH] Actually fixing the Resize layout fill bug --- src/widgets/resize.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/widgets/resize.rs b/src/widgets/resize.rs index 20800b2..195cf94 100644 --- a/src/widgets/resize.rs +++ b/src/widgets/resize.rs @@ -117,6 +117,10 @@ impl WrapperWidget for Resize { || matches!(available_space.height, ConstraintLimit::SizeToFit(_)), ) }; + let size = Size::new( + self.width.clamp(size.width, context.gfx.scale()), + self.height.clamp(size.height, context.gfx.scale()), + ); if fill_layout { // Now that we have our known dimension, give the child an opportunity // to lay out with Fill semantics. @@ -125,12 +129,7 @@ impl WrapperWidget for Resize { .layout(size.map(ConstraintLimit::Fill)); } - Size::new( - self.width.clamp(size.width, context.gfx.scale()), - self.height.clamp(size.height, context.gfx.scale()), - ) - .into_signed() - .into() + size.into_signed().into() } }