From 76c014440b5b380dad96392fa1c640fd491c41c3 Mon Sep 17 00:00:00 2001 From: Alexander van Saase Date: Wed, 11 Oct 2023 22:45:55 +0200 Subject: [PATCH] Fix child with Fill width pushing grid from frame --- src/native/grid.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/native/grid.rs b/src/native/grid.rs index bae2740b..29e965ef 100644 --- a/src/native/grid.rs +++ b/src/native/grid.rs @@ -210,6 +210,8 @@ where return Node::new(Size::ZERO); } + let limits = limits.width(self.width()).height(self.height()); + // Calculate the column widths and row heights to fit the contents let mut min_columns_widths = Vec::::with_capacity(self.column_count()); let mut min_row_heights = Vec::::with_capacity(self.row_count()); @@ -219,7 +221,7 @@ where let mut row_height = 0.0f32; for (col_idx, element) in row.elements.iter().enumerate() { - let layout = element.as_widget().layout(renderer, limits); + let layout = element.as_widget().layout(renderer, &limits); let Size { width, height } = layout.size(); #[allow(clippy::option_if_let_else)] @@ -253,7 +255,7 @@ where }; let cell_size = Size::new(col_width, row_height); - let mut node = element.as_widget().layout(renderer, limits); + let mut node = element.as_widget().layout(renderer, &limits); node.move_to(Point::new(x, y)); node.align( self.horizontal_alignment.into(),