[libgdx] Fixed snap when a mix completes while later mixes are still in progress.

The limit is a, not 0.
This commit is contained in:
Nathan Sweet 2026-03-24 00:20:52 -04:00
parent f68e498154
commit 2c53123666

View File

@ -255,7 +255,8 @@ public class AnimationState {
boolean attachments = mix < from.mixAttachmentThreshold, drawOrder = mix < from.mixDrawOrderThreshold;
int timelineCount = from.animation.timelines.size;
Timeline[] timelines = from.animation.timelines.items;
float alphaMix = from.alpha * fromMix * (1 - mix), keep = 1 - mix * to.alpha, alphaHold = keep > 0 ? alphaMix / keep : 0;
float a = from.alpha * fromMix, keep = 1 - mix * to.alpha;
float alphaMix = a * (1 - mix), alphaHold = keep > 0 ? alphaMix / keep : a;
float animationLast = from.animationLast, animationTime = from.getAnimationTime(), applyTime = animationTime;
Array<Event> events = null;
if (from.reverse)
@ -291,12 +292,10 @@ public class AnimationState {
timeline.apply(skeleton, animationLast, applyTime, events, alpha, fromSetup, add, out, false);
}
}
if (to.mixDuration > 0) queueEvents(from, animationTime);
this.events.clear();
from.nextAnimationLast = animationTime;
from.nextTrackLast = from.trackTime;
return mix;
}