diff options
author | volzhs <volzhs@gmail.com> | 2020-11-25 05:30:55 +0900 |
---|---|---|
committer | volzhs <volzhs@gmail.com> | 2020-11-25 05:30:55 +0900 |
commit | 67c2f2445f9b41b89dbdc55fff67ce347e0f63a9 (patch) | |
tree | 81d3e00975cca71f8d96183506069c4b72504aac /scene/gui/scroll_container.cpp | |
parent | 32b31a5fa47b1e068be98f3196cf5d83a2260667 (diff) |
Fix to update scroll bar has correct max value in ScrollContainer
Diffstat (limited to 'scene/gui/scroll_container.cpp')
-rw-r--r-- | scene/gui/scroll_container.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index f4e31c45d2..8aad5f262d 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -414,12 +414,12 @@ void ScrollContainer::update_scrollbars() { bool hide_scroll_v = !scroll_v || min.height <= size.height; bool hide_scroll_h = !scroll_h || min.width <= size.width; + v_scroll->set_max(min.height); if (hide_scroll_v) { v_scroll->hide(); scroll.y = 0; } else { v_scroll->show(); - v_scroll->set_max(min.height); if (hide_scroll_h) { v_scroll->set_page(size.height); } else { @@ -429,12 +429,12 @@ void ScrollContainer::update_scrollbars() { scroll.y = v_scroll->get_value(); } + h_scroll->set_max(min.width); if (hide_scroll_h) { h_scroll->hide(); scroll.x = 0; } else { h_scroll->show(); - h_scroll->set_max(min.width); if (hide_scroll_v) { h_scroll->set_page(size.width); } else { |