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

This commit is contained in:
badlogic 2018-01-12 11:08:49 +01:00
parent ce124e381e
commit dd61552c82

View File

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