فهرست منبع

Fix TextEdit cursor.column having a negative value

(cherry picked from commit 1d55207fd2d80d8dec0d246bda69117fe211b74c)
Paulb23 6 سال پیش
والد
کامیت
8148732bd1
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      scene/gui/text_edit.cpp

+ 1 - 1
scene/gui/text_edit.cpp

@@ -3891,7 +3891,7 @@ void TextEdit::cursor_set_line(int p_row, bool p_adjust_viewport, bool p_can_be_
 	cursor.line = p_row;
 	cursor.line = p_row;
 
 
 	int n_col = get_char_pos_for_line(cursor.last_fit_x, p_row, p_wrap_index);
 	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);
 		Vector<String> rows = get_wrap_rows_text(p_row);
 		int row_end_col = 0;
 		int row_end_col = 0;
 		for (int i = 0; i < p_wrap_index + 1; i++) {
 		for (int i = 0; i < p_wrap_index + 1; i++) {