You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 19:11:41 +00:00
Fix to update scroll bar has correct max value in ScrollContainer
(cherry picked from commit 67c2f2445f)
This commit is contained in:
@@ -421,6 +421,7 @@ 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();
|
||||
@@ -428,7 +429,6 @@ void ScrollContainer::update_scrollbars() {
|
||||
} else {
|
||||
|
||||
v_scroll->show();
|
||||
v_scroll->set_max(min.height);
|
||||
if (hide_scroll_h) {
|
||||
v_scroll->set_page(size.height);
|
||||
} else {
|
||||
@@ -438,6 +438,7 @@ void ScrollContainer::update_scrollbars() {
|
||||
scroll.y = v_scroll->get_value();
|
||||
}
|
||||
|
||||
h_scroll->set_max(min.width);
|
||||
if (hide_scroll_h) {
|
||||
|
||||
h_scroll->hide();
|
||||
@@ -445,7 +446,6 @@ void ScrollContainer::update_scrollbars() {
|
||||
} else {
|
||||
|
||||
h_scroll->show();
|
||||
h_scroll->set_max(min.width);
|
||||
if (hide_scroll_v) {
|
||||
h_scroll->set_page(size.width);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user