diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-08-26 22:44:52 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-08-26 22:44:52 +0200 |
commit | a5e157dd3719b55dc0776b992a67a1ea8083febd (patch) | |
tree | ec47cbdab821bd135c8efdad9c5d52c75d4a6437 | |
parent | 2c14f3ef95322589650ea94bd25cf931331f1a3f (diff) | |
parent | 0f7c4d8375e5066500ad9a44402adbb197d1c1a2 (diff) | |
download | redot-engine-a5e157dd3719b55dc0776b992a67a1ea8083febd.tar.gz |
Merge pull request #91854 from ImpishOaths/PullReady
Don't lose in/out handles when bezier keyframe inserted on top of existing keyframe
-rw-r--r-- | editor/animation_track_editor.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 5706853b2a..f4403780c2 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -4500,7 +4500,14 @@ AnimationTrackEditor::TrackIndices AnimationTrackEditor::_confirm_insert(InsertD } break; case Animation::TYPE_BEZIER: { - value = animation->make_default_bezier_key(p_id.value); + int existing = animation->track_find_key(p_id.track_idx, time, Animation::FIND_MODE_APPROX); + if (existing != -1) { + Array arr = animation->track_get_key_value(p_id.track_idx, existing); + arr[0] = p_id.value; + value = arr; + } else { + value = animation->make_default_bezier_key(p_id.value); + } bezier_edit_icon->set_disabled(false); } break; default: { |