summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-10-21 13:54:44 +0200
committerGitHub <noreply@github.com>2019-10-21 13:54:44 +0200
commit9c1faadcf9bac6f5c3100e0165e395d1abb20dcb (patch)
tree32b667225776e187ab901718b547035d091bdacf
parent28eca3649d1aecf0845c70a3e722b7cfee517660 (diff)
parentee94081b4adb3e0d561e7c2ad0aa5f0bc8ca8c8e (diff)
Merge pull request #32939 from Paulb23/issue_32785_minimap_index
Fixed -1 minimap index when smooth scrolling is enabled
-rw-r--r--scene/gui/text_edit.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 5f9b913e8c..69d076c41b 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -935,7 +935,7 @@ void TextEdit::_notification(int p_what) {
int minimap_line = (v_scroll->get_max() <= minimap_visible_lines) ? -1 : first_visible_line;
if (minimap_line >= 0) {
minimap_line -= num_lines_from_rows(first_visible_line, 0, -num_lines_before, wi);
- minimap_line -= (smooth_scroll_enabled ? 1 : 0);
+ minimap_line -= (minimap_line > 0 && smooth_scroll_enabled ? 1 : 0);
}
int minimap_draw_amount = minimap_visible_lines + times_line_wraps(minimap_line + 1);
@@ -2146,7 +2146,7 @@ void TextEdit::_get_minimap_mouse_row(const Point2i &p_mouse, int &r_row) const
int minimap_line = (v_scroll->get_max() <= minimap_visible_lines) ? -1 : first_visible_line;
if (first_visible_line > 0 && minimap_line >= 0) {
minimap_line -= num_lines_from_rows(first_visible_line, 0, -num_lines_before, wi);
- minimap_line -= (smooth_scroll_enabled ? 1 : 0);
+ minimap_line -= (minimap_line > 0 && smooth_scroll_enabled ? 1 : 0);
} else {
minimap_line = 0;
}