summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-02-17 15:20:19 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-02-17 15:20:19 +0100
commit9004279afb5b4482383068059876d24d5870f2c0 (patch)
treed6b1117ea295324cc65713349f60699433bd8a75 /scene/gui
parent7c7ba88d19a80b4f05c8ec137ecd2b920bedad12 (diff)
parentaa024296d162c156bf07ddd23341789c2ee371eb (diff)
Merge pull request #70781 from jamesmintram/jamesm/bugfix/fix-minimap-oob
Fix error spam when hovering minimap in the script editor
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/text_edit.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index d785280701..2b3b577697 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -4362,7 +4362,9 @@ int TextEdit::get_minimap_line_at_pos(const Point2i &p_pos) const {
if (first_vis_line > 0 && minimap_line >= 0) {
minimap_line -= get_next_visible_line_index_offset_from(first_vis_line, 0, -num_lines_before).x;
minimap_line -= (minimap_line > 0 && smooth_scroll_enabled ? 1 : 0);
- } else {
+ }
+
+ if (minimap_line < 0) {
minimap_line = 0;
}