Fixed first event not getting fired.

Damn this is hard to get exactly right!
This commit is contained in:
NathanSweet 2013-09-29 23:42:55 +02:00
parent af5aca8b66
commit 2dc486b2d5
3 changed files with 3 additions and 3 deletions

View File

@ -524,7 +524,7 @@ void _EventTimeline_apply (const Timeline* timeline, Skeleton* skeleton, float l
lastTime = 0;
} else if (lastTime >= self->frames[self->framesLength - 1]) return; /* Last time is after last frame. */
if (lastTime < self->frames[0] || self->framesLength == 1)
if (lastTime <= self->frames[0] || self->framesLength == 1)
frameIndex = 0;
else {
float frame;

View File

@ -479,7 +479,7 @@ namespace Spine {
} else if (lastTime >= frames[frameCount - 1]) return; // Last time is after last frame.
int frameIndex;
if (lastTime < frames[0] || frameCount == 1)
if (lastTime <= frames[0] || frameCount == 1)
frameIndex = 0;
else {
frameIndex = Animation.binarySearch(frames, lastTime, 1);

View File

@ -553,7 +553,7 @@ public class Animation {
} else if (lastTime >= frames[frameCount - 1]) return; // Last time is after last frame.
int frameIndex;
if (lastTime < frames[0] || frameCount == 1)
if (lastTime <= frames[0] || frameCount == 1)
frameIndex = 0;
else {
frameIndex = binarySearch(frames, lastTime, 1);