Skip to content

Commit

Permalink
Merge pull request #88352 from CookieBadger/bezier-handle-mode-undo-fix
Browse files Browse the repository at this point in the history
Fix Bezier Editor HandleMode UndoRedo History mismatch
  • Loading branch information
akien-mga committed Feb 15, 2024
2 parents fba467c + 0f7b4e4 commit b8a402b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion editor/animation_bezier_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ void AnimationBezierTrackEdit::_clear_selection() {

void AnimationBezierTrackEdit::_change_selected_keys_handle_mode(Animation::HandleMode p_mode, bool p_auto) {
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
undo_redo->create_action(TTR("Update Selected Key Handles"));
undo_redo->create_action(TTR("Update Selected Key Handles"), UndoRedo::MERGE_DISABLE, animation.ptr());
for (SelectionSet::Element *E = selection.back(); E; E = E->prev()) {
const IntPair track_key_pair = E->get();
undo_redo->add_undo_method(editor, "_bezier_track_set_key_handle_mode", animation.ptr(), track_key_pair.first, track_key_pair.second, animation->bezier_track_get_key_handle_mode(track_key_pair.first, track_key_pair.second), Animation::HANDLE_SET_MODE_NONE);
Expand Down
2 changes: 1 addition & 1 deletion editor/animation_track_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ bool AnimationTrackKeyEdit::_set(const StringName &p_name, const Variant &p_valu
const Variant &value = p_value;

setting = true;
undo_redo->create_action(TTR("Animation Change Keyframe Value"), UndoRedo::MERGE_ENDS);
undo_redo->create_action(TTR("Animation Change Keyframe Value"), UndoRedo::MERGE_ENDS, animation.ptr());
int prev_mode = animation->bezier_track_get_key_handle_mode(track, key);
Vector2 prev_in_handle = animation->bezier_track_get_key_in_handle(track, key);
Vector2 prev_out_handle = animation->bezier_track_get_key_out_handle(track, key);
Expand Down

0 comments on commit b8a402b

Please sign in to comment.