From f3dfa1c8b9ab4441a6763cef9e15c46582b4ab6d Mon Sep 17 00:00:00 2001 From: volzhs Date: Tue, 28 Aug 2018 22:41:33 +0900 Subject: Precise size calculation of ScrollContainer --- scene/gui/scroll_container.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scene/gui') diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index 495d618930..977d345ca8 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -368,8 +368,10 @@ void ScrollContainer::update_scrollbars() { Ref 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; -- cgit v1.2.3