Skip to content

Commit

Permalink
Merge pull request #87012 from TheSofox/line-edit-undo-caret-fix
Browse files Browse the repository at this point in the history
Fix `LineEdit` caret rendering/positioning on Undo.
  • Loading branch information
akien-mga committed Jan 15, 2024
2 parents 378b3ca + 6888d95 commit 3482da4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scene/gui/line_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1227,9 +1227,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();
}

Expand All @@ -1251,9 +1252,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();
}

Expand Down

0 comments on commit 3482da4

Please sign in to comment.