浏览代码

Merge pull request #28847 from YeldhamDev/textedit_wrap_highlight_fix

Fix 'TextEdit's line wrapping being highlighted incorrectly
Rémi Verschelde 6 年之前
父节点
当前提交
1acc918166
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scene/gui/text_edit.cpp

+ 1 - 1
scene/gui/text_edit.cpp

@@ -1106,7 +1106,7 @@ void TextEdit::_notification(int p_what) {
 						if (line == cursor.line && cursor_wrap_index == line_wrap_index && highlight_current_line) {
 						if (line == cursor.line && cursor_wrap_index == line_wrap_index && highlight_current_line) {
 							// draw the wrap indent offset highlight
 							// draw the wrap indent offset highlight
 							if (line_wrap_index != 0 && j == 0) {
 							if (line_wrap_index != 0 && j == 0) {
-								VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(char_ofs + char_margin - indent_px, ofs_y, (char_ofs + char_margin), get_row_height()), cache.current_line_color);
+								VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(char_ofs + char_margin - indent_px, ofs_y, indent_px, get_row_height()), cache.current_line_color);
 							}
 							}
 							// if its the last char draw to end of the line
 							// if its the last char draw to end of the line
 							if (j == str.length() - 1) {
 							if (j == str.length() - 1) {