浏览代码

Merge pull request #101175 from wareya/wrap_perf_fix

Fix large `TextEdit` width resize performance when wrapping disabled
Rémi Verschelde 8 月之前
父节点
当前提交
ef9f0aefd0
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      scene/gui/text_edit.cpp

+ 5 - 4
scene/gui/text_edit.cpp

@@ -7955,12 +7955,13 @@ void TextEdit::_update_wrap_at_column(bool p_force) {
 			}
 			text.set_brk_flags(autowrap_flags);
 			text.set_width(wrap_at_column);
-		} else {
+			text.invalidate_all_lines();
+			_update_placeholder();
+		} else if (text.get_width() != -1) {
 			text.set_width(-1);
+			text.invalidate_all_lines();
+			_update_placeholder();
 		}
-
-		text.invalidate_all_lines();
-		_update_placeholder();
 	}
 
 	// Update viewport.