Fix ScrollContainer ignoring internal nodes added externally

This commit is contained in:
Michael Alexsander 2025-12-03 09:04:58 -03:00
parent 7a228b4b91
commit ad22add5ca
No known key found for this signature in database
GPG key ID: A9C91EE110F4EABA

View file

@ -46,6 +46,7 @@ Size2 ScrollContainer::get_minimum_size() const {
if (!c) { if (!c) {
continue; continue;
} }
// Ignore the scroll hints.
if (c == h_scroll || c == v_scroll || c == focus_panel) { if (c == h_scroll || c == v_scroll || c == focus_panel) {
continue; continue;
} }
@ -364,7 +365,7 @@ void ScrollContainer::_reposition_children() {
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)); Control *c = as_sortable_control(get_child(i));
if (!c || c->is_internal()) { if (!c || c == h_scroll || c == v_scroll || c == focus_panel || c == scroll_hint_top_left || c == scroll_hint_bottom_right) {
continue; continue;
} }
Size2 minsize = c->get_combined_minimum_size(); Size2 minsize = c->get_combined_minimum_size();
@ -770,7 +771,7 @@ PackedStringArray ScrollContainer::get_configuration_warnings() const {
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), SortableVisibilityMode::VISIBLE); Control *c = as_sortable_control(get_child(i), SortableVisibilityMode::VISIBLE);
if (!c || c->is_internal()) { if (!c || c == h_scroll || c == v_scroll || c == focus_panel || c == scroll_hint_top_left || c == scroll_hint_bottom_right) {
continue; continue;
} }