Skip to content

Commit 0fefd6c

Browse files
committed
Fix GridContainer minimum size when there's a hidden parent
When calculating minimum size, GridContainer only looks at children that are returned from `as_sortable_control()`. That defaults to only showing children visible in the tree, so if the grid has a hidden parent the minimum size becomes (0, 0). After this change only the child itself needs to be visible, making `GridContainer::get_minimum_size()` behave the same way as other controls. Fixes #91722.
1 parent b75f048 commit 0fefd6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scene/gui/grid_container.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ Size2 GridContainer::get_minimum_size() const {
279279

280280
int valid_controls_index = 0;
281281
for (int i = 0; i < get_child_count(); i++) {
282-
Control *c = as_sortable_control(get_child(i));
282+
Control *c = as_sortable_control(get_child(i), SortableVisbilityMode::VISIBLE);
283283
if (!c) {
284284
continue;
285285
}

0 commit comments

Comments
 (0)