dschnare/rekapi — pull request #1 by jeremyckahn (2014-04-05 22:45:00+00:00)
Title: Bugfix — Undefined early keyframes

This fixes a scenario in which Rekapi was not producing useful values for properties where the first keyframe in the timeline had not yet been reached.

Prior to this patch, Rekapi would produce `undefined` for keyframe property values if it was computing a state in the timeline before the first defined keyframe was reached. This patch changes the caching behavior such that the first keyframe tweens against itself if it has not yet been reached in the timeline, rather than being a no-op. This results in keyframes always producing some kind of a state, assuming that there is a keyframe at some point in the future to tween against.

This fixes the bugs described in #32. It does not address the easing source keyframe part of that discussion, though.

@dschnare, can you please review this and test it out? If this looks good to you, I will merge it into my fork's `master` branch.

A good way to try this out is to use the API tester (it's a little web app at `/sandbox.html`). I tested against these keyframes:

````javascript
actor
.keyframe(0, {
x: 100
}).keyframe(1000, {
y: 200
}).keyframe(2000, {
y: 300
});
````

Try these keyframes before and after this patch to see the change.