Ver código fonte

Fixed interruptAlpha NaN when there is no mixingFrom.

NathanSweet 8 anos atrás
pai
commit
2349356584

+ 5 - 1
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java

@@ -414,7 +414,11 @@ public class AnimationState {
 			if (interrupt) queue.interrupt(from);
 			current.mixingFrom = from;
 			current.mixTime = 0;
-			current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration); // Store interrupted mix percentage.
+
+			// Store the interrupted mix percentage.
+			if (from.mixingFrom != null && from.mixDuration > 0)
+				current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration);
+
 			from.timelinesRotation.clear(); // Reset rotation for mixing out, in case entry was mixed in.
 		}