summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-10-07 19:18:05 +0200
committerGitHub <noreply@github.com>2019-10-07 19:18:05 +0200
commit667e464e64c98692b3ea1412a143c624d754dbb7 (patch)
tree77eb77c7e8883a81c44941cc8f6cbb88e5aa5275 /scene
parent234289de2b10b76d368650a144a35c040a196ee0 (diff)
parent6025a76c78fe63d8badc3a86717a8f26fd4e4ec5 (diff)
Merge pull request #32626 from Paulb23/issue_27631_caret_draw_eol
Fixed drawing the caret at eol when at eol is not visible
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/text_edit.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index e2bb4e3e91..c0b0944e47 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1271,7 +1271,8 @@ void TextEdit::_notification(int p_what) {
}
// Loop through characters in one line.
- for (int j = 0; j < str.length(); j++) {
+ int j = 0;
+ for (; j < str.length(); j++) {
if (syntax_coloring) {
if (color_map.has(last_wrap_column + j)) {
@@ -1501,7 +1502,7 @@ void TextEdit::_notification(int p_what) {
}
}
- if (cursor.column == last_wrap_column + str.length() && cursor.line == line && cursor_wrap_index == line_wrap_index && (char_ofs + char_margin) >= xmargin_beg) {
+ if (cursor.column == (last_wrap_column + j) && cursor.line == line && cursor_wrap_index == line_wrap_index && (char_ofs + char_margin) >= xmargin_beg) {
cursor_pos = Point2i(char_ofs + char_margin + ofs_x, ofs_y);
cursor_pos.y += (get_row_height() - cache.font->get_height()) / 2;