mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
Fixed first event not getting fired.
Damn this is hard to get exactly right!
This commit is contained in:
parent
af5aca8b66
commit
2dc486b2d5
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user