summaryrefslogtreecommitdiff
path: root/scene/gui/text_edit.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-08-20 15:25:46 +0200
committerGitHub <noreply@github.com>2017-08-20 15:25:46 +0200
commit9720e94dce358391ec532cbc1ba379b2fcf571a4 (patch)
tree82b94ba3ecf96487ca6b99ef80ce6e1b1b9e9b2a /scene/gui/text_edit.cpp
parentf4e2baae7fa54f2501818be4bc7963995fe427fd (diff)
parenta0457341fc0b9e6758423de8df4a75f8e36ea90a (diff)
Merge pull request #10479 from Paulb23/fix_not_scrolling_eof
Fixed not being able to scroll to eof
Diffstat (limited to 'scene/gui/text_edit.cpp')
-rw-r--r--scene/gui/text_edit.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 650fdfbc5f..f99cbbad89 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -487,7 +487,7 @@ void TextEdit::_notification(int p_what) {
int ascent = cache.font->get_ascent();
- int visible_rows = get_visible_rows();
+ int visible_rows = get_visible_rows() + 1;
int tab_w = cache.font->get_char_size(' ').width * indent_size;
@@ -3153,7 +3153,7 @@ int TextEdit::get_visible_rows() const {
int total = cache.size.height;
total -= cache.style_normal->get_minimum_size().height;
total /= get_row_height();
- return total + 1;
+ return total;
}
void TextEdit::adjust_viewport_to_cursor() {
@@ -3172,7 +3172,7 @@ void TextEdit::adjust_viewport_to_cursor() {
visible_rows -= ((h_scroll->get_combined_minimum_size().height - 1) / get_row_height());
if (cursor.line >= (cursor.line_ofs + visible_rows))
- cursor.line_ofs = cursor.line - visible_rows + 1;
+ cursor.line_ofs = cursor.line - visible_rows;
if (cursor.line < cursor.line_ofs)
cursor.line_ofs = cursor.line;