Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

TextEdit: Use double for maximum vertical scroll amount

NoNormalDevb6b5b907cef9
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 0d60e11cf51..ec010dccebb 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -9255,7 +9255,7 @@ void TextEdit::_scroll_down(real_t p_delta, bool p_animate) {
}
if (smooth_scroll_enabled) {
- int max_v_scroll = std::round(v_scroll->get_max() - v_scroll->get_page());
+ double max_v_scroll = v_scroll->get_max() - v_scroll->get_page();
if (target_v_scroll > max_v_scroll) {
target_v_scroll = max_v_scroll;
}