瀏覽代碼

Fix LineEdit caret rendering/positioning on Undo.

Sofox 1 年之前
父節點
當前提交
6888d957dc
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      scene/gui/line_edit.cpp

+ 4 - 2
scene/gui/line_edit.cpp

@@ -1228,9 +1228,10 @@ void LineEdit::undo() {
 	TextOperation op = undo_stack_pos->get();
 	text = op.text;
 	scroll_offset = op.scroll_offset;
-	set_caret_column(op.caret_column);
 
 	_shape();
+	set_caret_column(op.caret_column);
+
 	_emit_text_change();
 }
 
@@ -1252,9 +1253,10 @@ void LineEdit::redo() {
 	TextOperation op = undo_stack_pos->get();
 	text = op.text;
 	scroll_offset = op.scroll_offset;
-	set_caret_column(op.caret_column);
 
 	_shape();
+	set_caret_column(op.caret_column);
+
 	_emit_text_change();
 }