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

This commit is contained in:
badlogic 2018-05-16 11:36:23 +02:00
parent ca15f5e64f
commit 6c18d55d94

View File

@ -585,7 +585,7 @@ function AnimationState:queueEvents (entry, animationTime)
-- Queue complete if completed a loop iteration or the animation. -- Queue complete if completed a loop iteration or the animation.
local queueComplete = false local queueComplete = false
if entry.loop then if entry.loop then
queueComplete = (trackLastWrapped > entry.trackTime % duration) queueComplete = duration == 0 or (trackLastWrapped > entry.trackTime % duration)
else else
queueComplete = (animationTime >= animationEnd and entry.animationLast < animationEnd) queueComplete = (animationTime >= animationEnd and entry.animationLast < animationEnd)
end end