summaryrefslogtreecommitdiffstats
path: root/scene/gui/graph_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/graph_node.cpp')
-rw-r--r--scene/gui/graph_node.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp
index d035515b51..75ac5c5135 100644
--- a/scene/gui/graph_node.cpp
+++ b/scene/gui/graph_node.cpp
@@ -175,9 +175,8 @@ void GraphNode::_resort() {
HashMap<Control *, _MinSizeCache> min_size_cache;
for (int i = 0; i < get_child_count(false); i++) {
- Control *child = Object::cast_to<Control>(get_child(i, false));
-
- if (!child || !child->is_visible_in_tree() || child->is_set_as_top_level()) {
+ Control *child = as_sortable_control(get_child(i, false));
+ if (!child) {
continue;
}
@@ -218,8 +217,8 @@ void GraphNode::_resort() {
bool refit_successful = true;
for (int i = 0; i < get_child_count(false); i++) {
- Control *child = Object::cast_to<Control>(get_child(i, false));
- if (!child || !child->is_visible_in_tree() || child->is_set_as_top_level()) {
+ Control *child = as_sortable_control(get_child(i, false));
+ if (!child) {
continue;
}
@@ -256,8 +255,8 @@ void GraphNode::_resort() {
int width = new_size.width - sb_panel->get_minimum_size().width;
int valid_children_idx = 0;
for (int i = 0; i < get_child_count(false); i++) {
- Control *child = Object::cast_to<Control>(get_child(i, false));
- if (!child || !child->is_visible_in_tree() || child->is_set_as_top_level()) {
+ Control *child = as_sortable_control(get_child(i, false));
+ if (!child) {
continue;
}
@@ -614,8 +613,8 @@ Size2 GraphNode::get_minimum_size() const {
Size2 minsize = titlebar_hbox->get_minimum_size() + sb_titlebar->get_minimum_size();
for (int i = 0; i < get_child_count(false); i++) {
- Control *child = Object::cast_to<Control>(get_child(i, false));
- if (!child || !child->is_visible() || child->is_set_as_top_level()) {
+ Control *child = as_sortable_control(get_child(i, false));
+ if (!child) {
continue;
}