summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-03-07 14:19:43 +0100
committerGitHub <noreply@github.com>2019-03-07 14:19:43 +0100
commite28e8490120d38f4b8d96c004075c239fce7ef80 (patch)
treea01e3d1fe07deac1b7ee87cf7bee0fad8fb14cb0
parent06dbeab5d4ba1ef9c58219260ced2b3fe2070553 (diff)
parentf3dfa1c8b9ab4441a6763cef9e15c46582b4ab6d (diff)
Merge pull request #21534 from volzhs/fix-scrollcontainer-size
Precise size calculation of ScrollContainer
-rw-r--r--scene/gui/scroll_container.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp
index 28292309b9..e50a71b0ff 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;