Browse Source

Merge pull request #21534 from volzhs/fix-scrollcontainer-size

Precise size calculation of ScrollContainer
Rémi Verschelde 6 năm trước cách đây
mục cha
commit
e28e849012
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      scene/gui/scroll_container.cpp

+ 4 - 2
scene/gui/scroll_container.cpp

@@ -368,8 +368,10 @@ void ScrollContainer::update_scrollbars() {
 	Ref<StyleBox> sb = get_stylebox("bg");
 	size -= sb->get_minimum_size();
 
-	Size2 hmin = h_scroll->get_combined_minimum_size();
-	Size2 vmin = v_scroll->get_combined_minimum_size();
+	Size2 hmin;
+	Size2 vmin;
+	if (scroll_h) hmin = h_scroll->get_combined_minimum_size();
+	if (scroll_v) vmin = v_scroll->get_combined_minimum_size();
 
 	Size2 min = child_max_size;