소스 검색

Fixes completion event firing for 0 duration animations. See #1112.

badlogic 7 년 전
부모
커밋
99ca67ca77
1개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 4
      spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java

+ 6 - 4
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java

@@ -386,10 +386,12 @@ public class AnimationState {
 		}
 
 		// Queue complete if completed a loop iteration or the animation.
-		if (entry.loop ? (trackLastWrapped > entry.trackTime % duration)
-			: (animationTime >= animationEnd && entry.animationLast < animationEnd)) {
-			queue.complete(entry);
-		}
+		boolean complete;
+		if (entry.loop)
+			complete = duration == 0 || trackLastWrapped > entry.trackTime % duration;
+		else
+			complete = animationTime >= animationEnd && entry.animationLast < animationEnd;
+		if (complete) queue.complete(entry);
 
 		// Queue events after complete.
 		for (; i < n; i++) {