Skip to content

Commit

Permalink
starting a playable now always resets its to the beginning
Browse files Browse the repository at this point in the history
  • Loading branch information
bchevalier committed Jan 5, 2017
1 parent 65c5ed7 commit 6a23b05
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tina",
"version": "0.3.15",
"version": "0.3.16",
"description": "Tweening and INterpolations for Animation",
"main": "src/index.js",
"scripts": {
Expand Down
14 changes: 7 additions & 7 deletions src/Playable.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,17 @@ Playable.prototype.start = function (timeOffset) {
return this;
}

if (this._player._add(this) === false) {
// Could not be added to player
return this;
}

if (timeOffset === undefined || timeOffset === null) {
timeOffset = 0;
}

this._startTime = this._player._time - timeOffset;

if (this._player._add(this) === false) {
// Could not be added to player
return this;
}

return this;
};

Expand All @@ -182,8 +183,7 @@ Playable.prototype._start = function () {

Playable.prototype.stop = function () {
if (this._player === null) {
console.warn('[Playable.stop] Trying to stop a playable that was never started.');
return;
return this;
}

// Stopping playable without performing any additional update nor completing
Expand Down

0 comments on commit 6a23b05

Please sign in to comment.