From 0fefd6cc80cef9e89afd4fc05630c74f626eecee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anni=20Ryyn=C3=A4nen?= Date: Thu, 20 Jun 2024 13:49:09 +0300 Subject: [PATCH] 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. --- scene/gui/grid_container.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/grid_container.cpp b/scene/gui/grid_container.cpp index a67bba786b0..5f04acf643a 100644 --- a/scene/gui/grid_container.cpp +++ b/scene/gui/grid_container.cpp @@ -279,7 +279,7 @@ Size2 GridContainer::get_minimum_size() const { int valid_controls_index = 0; for (int i = 0; i < get_child_count(); i++) { - Control *c = as_sortable_control(get_child(i)); + Control *c = as_sortable_control(get_child(i), SortableVisbilityMode::VISIBLE); if (!c) { continue; }