diff options
author | Juan Linietsky <juan@godotengine.org> | 2019-03-06 10:22:38 -0300 |
---|---|---|
committer | Juan Linietsky <juan@godotengine.org> | 2019-03-06 10:22:38 -0300 |
commit | 9b5c6f539b0049cbcf12507167eb028013219c45 (patch) | |
tree | 8d8136e07ac3e6514852832a2cda655e8fac0689 /core/undo_redo.cpp | |
parent | 4dd99701b087fd41a1563fb4722c61b067ef374b (diff) | |
download | redot-engine-9b5c6f539b0049cbcf12507167eb028013219c45.tar.gz |
Safer way to update animation if changed, fixes #26670
Diffstat (limited to 'core/undo_redo.cpp')
-rw-r--r-- | core/undo_redo.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/core/undo_redo.cpp b/core/undo_redo.cpp index 9a10e0585d..e13164d50f 100644 --- a/core/undo_redo.cpp +++ b/core/undo_redo.cpp @@ -250,8 +250,9 @@ void UndoRedo::commit_action() { if (action_level > 0) return; //still nested + commiting++; redo(); // perform action - + commiting--; if (callback && actions.size() > 0) { callback(callback_ud, actions[actions.size() - 1].name); } @@ -326,12 +327,10 @@ bool UndoRedo::redo() { if ((current_action + 1) >= actions.size()) return false; //nothing to redo - commiting++; current_action++; _process_operation_list(actions.write[current_action].do_ops.front()); version++; - commiting--; return true; } @@ -341,11 +340,9 @@ bool UndoRedo::undo() { ERR_FAIL_COND_V(action_level > 0, false); if (current_action < 0) return false; //nothing to redo - commiting++; _process_operation_list(actions.write[current_action].undo_ops.front()); current_action--; version--; - commiting--; return true; } |