Skip to content

Commit 76c0144

Browse files
committed
Fix child with Fill width pushing grid from frame
1 parent a150fb0 commit 76c0144

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/native/grid.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ where
210210
return Node::new(Size::ZERO);
211211
}
212212

213+
let limits = limits.width(self.width()).height(self.height());
214+
213215
// Calculate the column widths and row heights to fit the contents
214216
let mut min_columns_widths = Vec::<f32>::with_capacity(self.column_count());
215217
let mut min_row_heights = Vec::<f32>::with_capacity(self.row_count());
@@ -219,7 +221,7 @@ where
219221
let mut row_height = 0.0f32;
220222

221223
for (col_idx, element) in row.elements.iter().enumerate() {
222-
let layout = element.as_widget().layout(renderer, limits);
224+
let layout = element.as_widget().layout(renderer, &limits);
223225
let Size { width, height } = layout.size();
224226

225227
#[allow(clippy::option_if_let_else)]
@@ -253,7 +255,7 @@ where
253255
};
254256
let cell_size = Size::new(col_width, row_height);
255257

256-
let mut node = element.as_widget().layout(renderer, limits);
258+
let mut node = element.as_widget().layout(renderer, &limits);
257259
node.move_to(Point::new(x, y));
258260
node.align(
259261
self.horizontal_alignment.into(),

0 commit comments

Comments
 (0)