From 2c53123666284f61fca95233cd1892204f628650 Mon Sep 17 00:00:00 2001 From: Nathan Sweet Date: Tue, 24 Mar 2026 00:20:52 -0400 Subject: [PATCH] [libgdx] Fixed snap when a mix completes while later mixes are still in progress. The limit is a, not 0. --- .../src/com/esotericsoftware/spine/AnimationState.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java index f9a9e2850..649c0bc5d 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java @@ -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 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; }