diff options
author | volzhs <volzhs@gmail.com> | 2018-08-28 22:41:33 +0900 |
---|---|---|
committer | volzhs <volzhs@gmail.com> | 2018-08-29 20:08:45 +0900 |
commit | f3dfa1c8b9ab4441a6763cef9e15c46582b4ab6d (patch) | |
tree | 464cb3f45ef505a4620c0f314e55699bfb08d42a /scene/gui | |
parent | a651dbfe7e583267418a504597eaefb2d0da0ada (diff) |
Precise size calculation of ScrollContainer
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/scroll_container.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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<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; |