Jelajahi Sumber

[libgdx] Fix for #1064, delay was calculated incorrectly for non-loop previous track entries.

badlogic 7 tahun lalu
induk
melakukan
dd61552c82

+ 7 - 3
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java

@@ -528,9 +528,13 @@ public class AnimationState {
 			last.next = entry;
 			if (delay <= 0) {
 				float duration = last.animationEnd - last.animationStart;
-				if (duration != 0)
-					delay += duration * (1 + (int)(last.trackTime / duration)) - data.getMix(last.animation, animation);
-				else
+				if (duration != 0) {
+					if (last.loop)
+					    delay += duration * (1 + (int)(last.trackTime / duration));
+					else
+					    delay += duration;
+					delay -= data.getMix(last.animation, animation);				
+				}	else
 					delay = 0;
 			}
 		}