소스 검색

Merge pull request #113503 from YeldhamDev/its_an_internal_problem_you_see

Fix `ScrollContainer` ignoring internal nodes added externally
Rémi Verschelde 1 주 전
부모
커밋
2ecefada8d
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      scene/gui/scroll_container.cpp

+ 3 - 2
scene/gui/scroll_container.cpp

@@ -46,6 +46,7 @@ Size2 ScrollContainer::get_minimum_size() const {
 		if (!c) {
 			continue;
 		}
+		// Ignore the scroll hints.
 		if (c == h_scroll || c == v_scroll || c == focus_panel) {
 			continue;
 		}
@@ -364,7 +365,7 @@ void ScrollContainer::_reposition_children() {
 
 	for (int i = 0; i < get_child_count(); 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;
 		}
 		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++) {
 		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;
 		}