summaryrefslogtreecommitdiff
path: root/scene/gui/text_edit.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-11-21 14:25:15 +0100
committerGitHub <noreply@github.com>2017-11-21 14:25:15 +0100
commitfee2f367afc234afa541667ab800e2f65297e6bc (patch)
tree7fa463181983f86b13669dd9e21e259ca8fe97d7 /scene/gui/text_edit.cpp
parent1c2782a7c7456b4a473e519ebb40968c521911e7 (diff)
parent9240b7f2d16c0dce18ba5e3a0479920ffaede0fb (diff)
Merge pull request #13134 from Chaosus/fixinvalidscroll
Fix invalid scroll
Diffstat (limited to 'scene/gui/text_edit.cpp')
-rw-r--r--scene/gui/text_edit.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 2c47c4e827..69dc7b21fe 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -3488,7 +3488,10 @@ void TextEdit::adjust_viewport_to_cursor() {
cursor.x_ofs = cursor_x;
update_line_scroll_pos();
- v_scroll->set_value(get_line_scroll_pos() + 1);
+ if (get_line_scroll_pos() == 0)
+ v_scroll->set_value(0);
+ else
+ v_scroll->set_value(get_line_scroll_pos() + 1);
update();
/*
get_range()->set_max(text.size());