Fix even height distribution logic in grid widget
This commit is contained in:
parent
388a419ed5
commit
50cc94d944
1 changed files with 4 additions and 3 deletions
|
|
@ -202,9 +202,10 @@ where
|
||||||
let cell_height = match self.height {
|
let cell_height = match self.height {
|
||||||
Sizing::AspectRatio(ratio) => Some(cell_width / ratio),
|
Sizing::AspectRatio(ratio) => Some(cell_width / ratio),
|
||||||
Sizing::EvenlyDistribute(Length::Shrink) => None,
|
Sizing::EvenlyDistribute(Length::Shrink) => None,
|
||||||
Sizing::EvenlyDistribute(_) => {
|
Sizing::EvenlyDistribute(_) => Some(
|
||||||
Some(available.height / total_rows as f32)
|
(available.height - self.spacing * (total_rows - 1) as f32)
|
||||||
}
|
/ total_rows as f32,
|
||||||
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
let cell_limits = layout::Limits::new(
|
let cell_limits = layout::Limits::new(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue