summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-11-25 13:27:36 +0100
committerGitHub <noreply@github.com>2020-11-25 13:27:36 +0100
commit8c713fa9bf1084ddb9b48802b61f9818d57a622e (patch)
tree5a63e9aadfe4b4f1b2204cf0e4899da625061c41 /scene
parent81842a7cd621ab5401f0bda498d771d2e964c3bf (diff)
parent67c2f2445f9b41b89dbdc55fff67ce347e0f63a9 (diff)
Merge pull request #43833 from volzhs/fix-scrollcontainer-bar-max-value
Fix to update scroll bar has correct max value in ScrollContainer
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/scroll_container.cpp4
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 {