1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Add as_sortable_control() to unify Container checks

This commit is contained in:
kobewi
2024-05-06 12:38:51 +02:00
parent 17a81260cb
commit 5c28814b39
15 changed files with 65 additions and 170 deletions

View File

@@ -126,11 +126,8 @@ Control *SplitContainer::get_containable_child(int p_idx) const {
int idx = 0;
for (int i = 0; i < get_child_count(false); i++) {
Control *c = Object::cast_to<Control>(get_child(i, false));
if (!c || !c->is_visible()) {
continue;
}
if (c->is_set_as_top_level()) {
Control *c = as_sortable_control(get_child(i, false));
if (!c) {
continue;
}