Skip to content

Commit

Permalink
Fix delete keyframe not deleting trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
acidbubbles committed Apr 9, 2024
1 parent f2aae35 commit 08a8d5c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/AtomAnimations/Editing/AtomAnimationEditContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,16 @@ public void Delete()
{
if (!CanEdit()) return;
var time = clipTime;
if (time.IsSameFrame(0f)) return;
foreach (var target in current.targetTriggers)
{
target.DeleteFrame(time);
if (time.IsSameFrame(0f))
target.CreateKeyframe(0);
if (time.IsSameFrame(current.animationLength))
target.CreateKeyframe(current.animationLength.ToMilliseconds());
}
if (time.IsSameFrame(0f))
return;
if (time.IsSameFrame(current.animationLength))
{
if (current.loop) return;
Expand All @@ -498,7 +507,7 @@ public void Delete()

return;
}
foreach (var target in GetAllOrSelectedTargets())
foreach (var target in GetAllOrSelectedTargets().OfType<ICurveAnimationTarget>())
{
target.DeleteFrame(time);
}
Expand Down

0 comments on commit 08a8d5c

Please sign in to comment.