mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 15:21:56 -05:00
Fix LineEdit undo crash
Make sure all related member variables are initialized before creating the first undo state.
This commit is contained in:
@@ -1919,8 +1919,6 @@ void LineEdit::_bind_methods() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LineEdit::LineEdit() {
|
LineEdit::LineEdit() {
|
||||||
undo_stack_pos = nullptr;
|
|
||||||
_create_undo_state();
|
|
||||||
align = ALIGN_LEFT;
|
align = ALIGN_LEFT;
|
||||||
cached_width = 0;
|
cached_width = 0;
|
||||||
cached_placeholder_width = 0;
|
cached_placeholder_width = 0;
|
||||||
@@ -1938,6 +1936,9 @@ LineEdit::LineEdit() {
|
|||||||
shortcut_keys_enabled = true;
|
shortcut_keys_enabled = true;
|
||||||
selecting_enabled = true;
|
selecting_enabled = true;
|
||||||
|
|
||||||
|
undo_stack_pos = nullptr;
|
||||||
|
_create_undo_state();
|
||||||
|
|
||||||
deselect();
|
deselect();
|
||||||
set_focus_mode(FOCUS_ALL);
|
set_focus_mode(FOCUS_ALL);
|
||||||
set_default_cursor_shape(CURSOR_IBEAM);
|
set_default_cursor_shape(CURSOR_IBEAM);
|
||||||
|
|||||||
Reference in New Issue
Block a user