Jelajahi Sumber

Fix "Index out of size" TextEdit's spam to output

Chaosus 6 tahun lalu
induk
melakukan
e5f5a71d27
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      scene/gui/text_edit.cpp

+ 1 - 1
scene/gui/text_edit.cpp

@@ -4167,7 +4167,7 @@ void TextEdit::_scroll_moved(double p_to_val) {
 		int v_scroll_i = floor(get_v_scroll());
 		int v_scroll_i = floor(get_v_scroll());
 		int sc = 0;
 		int sc = 0;
 		int n_line;
 		int n_line;
-		for (n_line = 0; n_line < text.size(); n_line++) {
+		for (n_line = 0; n_line < text.size() - 1; n_line++) {
 			if (!is_line_hidden(n_line)) {
 			if (!is_line_hidden(n_line)) {
 				sc++;
 				sc++;
 				sc += times_line_wraps(n_line);
 				sc += times_line_wraps(n_line);