summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-10-06 12:36:17 +0200
committerGitHub <noreply@github.com>2018-10-06 12:36:17 +0200
commitd2043fad67b000188d2cdea9ac1ca6abe9f92ab7 (patch)
treeff0faef71d6c4f9ba3895447181fddc02db5e4a3
parent3d91af282e6c7b1dfefed1b1a04bb13d32e8d475 (diff)
parentf51ce0f7b142a47cca0964f313ebe031eddf8df1 (diff)
Merge pull request #22774 from kellams/master
Fix to scrolling, rounding error on max_v_scroll
-rw-r--r--scene/gui/text_edit.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index c390c60a8c..df0798b42c 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -3260,7 +3260,7 @@ void TextEdit::_scroll_down(real_t p_delta) {
}
if (smooth_scroll_enabled) {
- int max_v_scroll = v_scroll->get_max() - v_scroll->get_page();
+ int max_v_scroll = round(v_scroll->get_max() - v_scroll->get_page());
if (target_v_scroll > max_v_scroll) {
target_v_scroll = max_v_scroll;
v_scroll->set_value(target_v_scroll);