diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-06-15 00:29:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-15 00:29:07 +0200 |
commit | e9999290241d81ac6f67686cf3704705a430262c (patch) | |
tree | b28f8a68550d1bf161b016bfc798ae580414af24 | |
parent | 9a173e5814a335e9aef1f919f8f7e3772df39c19 (diff) | |
parent | 1d55207fd2d80d8dec0d246bda69117fe211b74c (diff) |
Merge pull request #29787 from Paulb23/fix_negative_cursor_column
Fix TextEdit cursor.column having a negative value
-rw-r--r-- | scene/gui/text_edit.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 6b40ecfc6b..83ce71e959 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -4078,7 +4078,7 @@ void TextEdit::cursor_set_line(int p_row, bool p_adjust_viewport, bool p_can_be_ cursor.line = p_row; int n_col = get_char_pos_for_line(cursor.last_fit_x, p_row, p_wrap_index); - if (is_wrap_enabled() && p_wrap_index < times_line_wraps(p_row)) { + if (n_col != 0 && is_wrap_enabled() && p_wrap_index < times_line_wraps(p_row)) { Vector<String> rows = get_wrap_rows_text(p_row); int row_end_col = 0; for (int i = 0; i < p_wrap_index + 1; i++) { |