Use max_cross if all elements are fluid in layout::flex
This commit is contained in:
parent
aa3c956516
commit
fd8f980b88
1 changed files with 3 additions and 4 deletions
|
|
@ -123,11 +123,11 @@ where
|
||||||
|
|
||||||
let max_cross = match axis {
|
let max_cross = match axis {
|
||||||
Axis::Horizontal => match height {
|
Axis::Horizontal => match height {
|
||||||
Length::Shrink => cross,
|
Length::Shrink if cross > 0.0 => cross,
|
||||||
_ => max_cross,
|
_ => max_cross,
|
||||||
},
|
},
|
||||||
Axis::Vertical => match width {
|
Axis::Vertical => match width {
|
||||||
Length::Shrink => cross,
|
Length::Shrink if cross > 0.0 => cross,
|
||||||
_ => max_cross,
|
_ => max_cross,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
@ -154,8 +154,7 @@ where
|
||||||
let (min_width, min_height) =
|
let (min_width, min_height) =
|
||||||
axis.pack(min_main, axis.cross(limits.min()));
|
axis.pack(min_main, axis.cross(limits.min()));
|
||||||
|
|
||||||
let (max_width, max_height) = axis
|
let (max_width, max_height) = axis.pack(max_main, max_cross);
|
||||||
.pack(max_main, max_cross * fill_cross_factor.max(1) as f32);
|
|
||||||
|
|
||||||
let child_limits = Limits::new(
|
let child_limits = Limits::new(
|
||||||
Size::new(min_width, min_height),
|
Size::new(min_width, min_height),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue