Skip to content

Commit

Permalink
Don't clear FFD if before first FFD key in animation.
Browse files Browse the repository at this point in the history
Didn't make any sense. Any existing FFD should remain until time passes a key.
  • Loading branch information
NathanSweet committed Nov 15, 2014
1 parent 31848ad commit ee1f13a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
5 changes: 1 addition & 4 deletions spine-as3/spine-as3/src/spine/animation/FfdTimeline.as
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ public class FfdTimeline extends CurveTimeline {
if (slot.attachment != attachment) return;

var frames:Vector.<Number> = this.frames;
if (time < frames[0]) {
slot.attachmentVertices.length = 0;
return; // Time is before first frame.
}
if (time < frames[0]) return; // Time is before first frame.

var frameVertices:Vector.<Vector.<Number>> = this.frameVertices;
var vertexCount:int = frameVertices[0].length;
Expand Down
5 changes: 1 addition & 4 deletions spine-c/src/spine/Animation.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,10 +659,7 @@ void _spFFDTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, flo
spSlot *slot = skeleton->slots[self->slotIndex];
if (slot->attachment != self->attachment) return;

if (time < self->frames[0]) {
slot->attachmentVerticesCount = 0;
return; /* Time is before first frame. */
}
if (time < self->frames[0]) return; /* Time is before first frame. */

if (slot->attachmentVerticesCount < self->frameVerticesCount) {
if (slot->attachmentVerticesCapacity < self->frameVerticesCount) {
Expand Down
5 changes: 1 addition & 4 deletions spine-csharp/src/Animation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -571,10 +571,7 @@ override public void Apply (Skeleton skeleton, float lastTime, float time, List<
if (slot.attachment != attachment) return;

float[] frames = this.frames;
if (time < frames[0]) {
slot.attachmentVerticesCount = 0;
return; // Time is before first frame.
}
if (time < frames[0]) return; // Time is before first frame.

float[][] frameVertices = this.frameVertices;
int vertexCount = frameVertices[0].Length;
Expand Down
5 changes: 1 addition & 4 deletions spine-js/spine.js
Original file line number Diff line number Diff line change
Expand Up @@ -774,10 +774,7 @@ spine.FfdTimeline.prototype = {
if (slot.attachment != attachment) return;

var frames = this.frames;
if (time < frames[0]) {
slot.attachmentVertices.length = 0;
return; // Time is before first frame.
}
if (time < frames[0]) return; // Time is before first frame.

var frameVertices = this.frameVertices;
var vertexCount = frameVertices[0].length;
Expand Down

0 comments on commit ee1f13a

Please sign in to comment.