Răsfoiți Sursa

Merge pull request #91757 from Chaosus/fix_color_picker_placement

Fix placement of ColorPicker in the editor
Rémi Verschelde 1 an în urmă
părinte
comite
a29482506a
2 a modificat fișierele cu 4 adăugiri și 4 ștergeri
  1. 2 2
      scene/gui/box_container.cpp
  2. 2 2
      scene/gui/margin_container.cpp

+ 2 - 2
scene/gui/box_container.cpp

@@ -243,8 +243,8 @@ Size2 BoxContainer::get_minimum_size() const {
 	bool first = true;
 	bool first = true;
 
 
 	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));
-		if (!c) {
+		Control *c = Object::cast_to<Control>(get_child(i));
+		if (!c || !c->is_visible() || c->is_set_as_top_level()) {
 			continue;
 			continue;
 		}
 		}
 
 

+ 2 - 2
scene/gui/margin_container.cpp

@@ -36,8 +36,8 @@ Size2 MarginContainer::get_minimum_size() const {
 	Size2 max;
 	Size2 max;
 
 
 	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));
-		if (!c) {
+		Control *c = Object::cast_to<Control>(get_child(i));
+		if (!c || !c->is_visible() || c->is_set_as_top_level()) {
 			continue;
 			continue;
 		}
 		}