diff options
Diffstat (limited to 'scene/gui/graph_element.cpp')
-rw-r--r-- | scene/gui/graph_element.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/scene/gui/graph_element.cpp b/scene/gui/graph_element.cpp index 9c13a3ad9e..e231b05d7f 100644 --- a/scene/gui/graph_element.cpp +++ b/scene/gui/graph_element.cpp @@ -49,14 +49,10 @@ void GraphElement::_resort() { Size2 size = get_size(); for (int i = 0; i < get_child_count(); i++) { - Control *child = Object::cast_to<Control>(get_child(i)); - if (!child || !child->is_visible_in_tree()) { - continue; - } - if (child->is_set_as_top_level()) { + Control *child = as_sortable_control(get_child(i)); + if (!child) { continue; } - fit_child_in_rect(child, Rect2(Point2(), size)); } } @@ -65,10 +61,7 @@ Size2 GraphElement::get_minimum_size() const { Size2 minsize; for (int i = 0; i < get_child_count(); i++) { Control *child = Object::cast_to<Control>(get_child(i)); - if (!child) { - continue; - } - if (child->is_set_as_top_level()) { + if (!child || child->is_set_as_top_level()) { continue; } |