diff options
author | Ian <ianb96@gmail.com> | 2017-11-28 16:52:52 -0500 |
---|---|---|
committer | Ian <ianb96@gmail.com> | 2017-11-28 16:52:52 -0500 |
commit | d1c7ed4117ccf7d2ae7e9e21857012e4c8651553 (patch) | |
tree | 7708fb76b6b2ef29f91aeae877ae39818bb2f157 | |
parent | edde7190abc65dcf2886cebc6f2486fd807e0e65 (diff) |
last line scroll fix when scroll_past_last_line is disabled
-rw-r--r-- | scene/gui/text_edit.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 166b55d6f3..6fa73e4b58 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -303,8 +303,6 @@ void TextEdit::_update_scrollbars() { int total_rows = (is_hiding_enabled() ? get_total_unhidden_rows() : text.size()); if (scroll_past_end_of_file_enabled) { total_rows += visible_rows - 1; - } else { - total_rows -= 1; } int vscroll_pixels = v_scroll->get_combined_minimum_size().width; @@ -3081,7 +3079,7 @@ void TextEdit::_scroll_down(real_t p_delta) { if (smooth_scroll_enabled) { int max_v_scroll = get_total_unhidden_rows(); if (!scroll_past_end_of_file_enabled) { - max_v_scroll -= get_visible_rows() + 1; + max_v_scroll -= get_visible_rows(); max_v_scroll = CLAMP(max_v_scroll, 0, get_total_unhidden_rows()); } @@ -3139,7 +3137,7 @@ void TextEdit::_scroll_lines_down() { // calculate the maximum vertical scroll position int max_v_scroll = get_total_unhidden_rows(); if (!scroll_past_end_of_file_enabled) { - max_v_scroll -= get_visible_rows() + 1; + max_v_scroll -= get_visible_rows(); max_v_scroll = CLAMP(max_v_scroll, 0, get_total_unhidden_rows()); } |