Skip to content

Commit

Permalink
fix grid layout max width again
Browse files Browse the repository at this point in the history
  • Loading branch information
Grokmoo committed Feb 29, 2024
1 parent 8fd48dd commit 60cdd4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ impl<'a> WidgetBuilder<'a> {
Vertical => parent.cursor.y += y + parent.layout_spacing.y,
Free => (),
Grid(max_width) => {
let max_x = parent.inner_size().x.min(max_width.map_or(0.0, |m| m as f32));
let max_x = parent.inner_size().x.max(max_width.map_or(0.0, |m| m as f32));

parent.cursor.x += x + parent.layout_spacing.x;
if parent.cursor.x + size.x > max_x {
Expand Down

0 comments on commit 60cdd4c

Please sign in to comment.