From b6f7e50ff79d280ba4a8958c4a07e04b920b5957 Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Tue, 12 Jan 2016 17:17:49 +0100 Subject: [PATCH] Fixed events on first frame not being fired for looping animations when their duration is 1s. --- .../src/com/esotericsoftware/spine/Animation.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java index c11d2a362..8ea375a27 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java @@ -71,7 +71,7 @@ public class Animation { if (loop && duration != 0) { time %= duration; - lastTime %= duration; + if (lastTime > 0) lastTime %= duration; } Array timelines = this.timelines; @@ -88,7 +88,7 @@ public class Animation { if (loop && duration != 0) { time %= duration; - lastTime %= duration; + if (lastTime > 0) lastTime %= duration; } Array timelines = this.timelines; @@ -516,8 +516,8 @@ public class Animation { if (frames[frameIndex] < lastTime) return; String attachmentName = attachmentNames[frameIndex]; - skeleton.slots.get(slotIndex).setAttachment( - attachmentName == null ? null : skeleton.getAttachment(slotIndex, attachmentName)); + skeleton.slots.get(slotIndex) + .setAttachment(attachmentName == null ? null : skeleton.getAttachment(slotIndex, attachmentName)); } }