Skip to content

Commit

Permalink
And test and fix for issue #77. (Closes #77)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyckahn committed Apr 24, 2015
1 parent 142a959 commit b83f272
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/shifty.core.js
Expand Up @@ -433,8 +433,8 @@ var Tweenable = (function () {
// any step handlers are run.
timeoutHandler(this,
this._timestamp,
this._duration,
this._delay,
this._duration,
this._currentState,
this._originalState,
this._targetState,
Expand Down
15 changes: 15 additions & 0 deletions tests/index.html
Expand Up @@ -134,6 +134,21 @@ <h2 id="qunit-userAgent"></h2>
equals(tweenable._timestamp, -500, 'The timestamp was properly offset');
});

test('seek() provides correct value to step handler via seek() (issue #77)', function () {
var computedX;
var tweenable = new Tweenable(null, {
from: { x: 0 },
to: { x: 100 },
duration: 1000,
step: function (state) {
computedX = state.x;
}
});

tweenable.seek(500);
equals(computedX, 50, 'Step handler got correct state value');
});

test('The seek() parameter cannot be less than 0', function () {
var tweenable = new Tweenable();
mockTime = function () {return 0;};
Expand Down

0 comments on commit b83f272

Please sign in to comment.