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

This commit is contained in:
badlogic 2018-05-16 11:26:22 +02:00
parent 0d2ca5a62b
commit 99ca67ca77

View File

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