summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-01-11 11:00:43 +0100
committerGitHub <noreply@github.com>2018-01-11 11:00:43 +0100
commit2f437e263ffeaf48e733b492eb3cb524ca3b4adc (patch)
treeb0c4eb2b7f75513442157b124b25c77eaa060b9d
parent554e95747c07afa893a2c4c0445370dda57aa7d0 (diff)
parentc1db81b9ed90e35d6916db0f62472174c362c8a2 (diff)
Merge pull request #15568 from poke1024/fix15418
Fixes empty line selection when scrolling
-rw-r--r--scene/gui/text_edit.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index f686dc52a0..aa4310da46 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -883,7 +883,7 @@ void TextEdit::_notification(int p_what) {
}
// give visual indication of empty selected line
- if (selection.active && line >= selection.from_line && line <= selection.to_line) {
+ if (selection.active && line >= selection.from_line && line <= selection.to_line && char_margin >= xmargin_beg) {
int char_w = cache.font->get_char_size(' ').width;
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, char_w, get_row_height()), cache.selection_color);
}