Fixed start event not being triggered when addAnimation is used on an empty track.

closes #634
This commit is contained in:
NathanSweet 2016-08-19 11:32:29 +02:00
parent 6aca4bd141
commit 4912ea8975
2 changed files with 12 additions and 1 deletions

View File

@ -364,6 +364,17 @@ public class AnimationStateTest {
}
});
setup("add animation on empty track", // 14
expect(0, "start", 0, 0), // s
expect(0, "event 0", 0, 0), //
expect(0, "event 14", 0.5f, 0.5f), //
expect(0, "event 30", 1, 1), //
expect(0, "complete 1", 1, 1), //
expect(0, "end", 1, 1.1f) //
);
state.addAnimation(0, "events1", false, 0);
run(0.1f, 1.9f);
System.out.println("AnimationState tests passed.");
}

View File

@ -301,7 +301,7 @@ public class AnimationState {
last = last.next;
last.next = entry;
} else
tracks.set(trackIndex, entry);
setCurrent(trackIndex, entry);
if (delay <= 0) {
if (last != null)