فهرست منبع

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.
Anni Ryynänen 1 سال پیش
والد
کامیت
0fefd6cc80
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      scene/gui/grid_container.cpp

+ 1 - 1
scene/gui/grid_container.cpp

@@ -279,7 +279,7 @@ Size2 GridContainer::get_minimum_size() const {
 
 
 	int valid_controls_index = 0;
 	int valid_controls_index = 0;
 	for (int i = 0; i < get_child_count(); i++) {
 	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) {
 		if (!c) {
 			continue;
 			continue;
 		}
 		}