From c1db81b9ed90e35d6916db0f62472174c362c8a2 Mon Sep 17 00:00:00 2001 From: poke1024 Date: Wed, 10 Jan 2018 21:12:14 +0100 Subject: [PATCH] Fixes empty line selection when scrolling --- scene/gui/text_edit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }