Fix even height distribution logic in grid widget

This commit is contained in:
Héctor Ramón Jiménez 2025-04-22 19:41:00 +02:00
parent 388a419ed5
commit 50cc94d944
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -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(