Skip to content

Commit c7fc877

Browse files
committed
Merge pull request godotengine#101745 from Rindbee/remove-is_top_level_control
Remove confusing `Control::is_top_level_control()`
2 parents ec675fc + f7397a0 commit c7fc877

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

scene/gui/control.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -624,11 +624,6 @@ bool Control::_property_get_revert(const StringName &p_name, Variant &r_property
624624

625625
// Global relations.
626626

627-
bool Control::is_top_level_control() const {
628-
ERR_READ_THREAD_GUARD_V(false);
629-
return is_inside_tree() && (!data.parent_canvas_item && !data.RI && is_set_as_top_level());
630-
}
631-
632627
Control *Control::get_parent_control() const {
633628
ERR_READ_THREAD_GUARD_V(nullptr);
634629
return data.parent_control;
@@ -648,10 +643,6 @@ Control *Control::get_root_parent_control() const {
648643
const Control *c = Object::cast_to<Control>(ci);
649644
if (c) {
650645
root = c;
651-
652-
if (c->data.RI || c->is_top_level_control()) {
653-
break;
654-
}
655646
}
656647

657648
ci = ci->get_parent_item();

scene/gui/control.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,6 @@ class Control : public CanvasItem {
454454

455455
// Global relations.
456456

457-
bool is_top_level_control() const;
458-
459457
Control *get_parent_control() const;
460458
Window *get_parent_window() const;
461459
Control *get_root_parent_control() const;

0 commit comments

Comments
 (0)