summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-03-27 14:40:03 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-04 06:53:07 +0100
commitfd8f980b88df260ce49d46ed6c514f6e382c6494 (patch)
treeae853ce56564885bbe2fd058ee1860b0824b21ba /core
parentaa3c956516a23af86dfb9d96b769e5f26addbe60 (diff)
downloadiced-fd8f980b88df260ce49d46ed6c514f6e382c6494.tar.gz
iced-fd8f980b88df260ce49d46ed6c514f6e382c6494.tar.bz2
iced-fd8f980b88df260ce49d46ed6c514f6e382c6494.zip
Use `max_cross` if all elements are fluid in `layout::flex`
Diffstat (limited to '')
-rw-r--r--core/src/layout/flex.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/core/src/layout/flex.rs b/core/src/layout/flex.rs
index 5ae98b8c..9a4b2cbf 100644
--- a/core/src/layout/flex.rs
+++ b/core/src/layout/flex.rs
@@ -123,11 +123,11 @@ where
let max_cross = match axis {
Axis::Horizontal => match height {
- Length::Shrink => cross,
+ Length::Shrink if cross > 0.0 => cross,
_ => max_cross,
},
Axis::Vertical => match width {
- Length::Shrink => cross,
+ Length::Shrink if cross > 0.0 => cross,
_ => max_cross,
},
};
@@ -154,8 +154,7 @@ where
let (min_width, min_height) =
axis.pack(min_main, axis.cross(limits.min()));
- let (max_width, max_height) = axis
- .pack(max_main, max_cross * fill_cross_factor.max(1) as f32);
+ let (max_width, max_height) = axis.pack(max_main, max_cross);
let child_limits = Limits::new(
Size::new(min_width, min_height),