Skip to content

Commit

Permalink
fix: Tween reverse onComplete not work, fix #165
Browse files Browse the repository at this point in the history
  • Loading branch information
06wj committed Jul 3, 2020
1 parent f484893 commit 2522897
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tween/Tween.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ return Class.create(/** @lends Tween.prototype */{
if(elapsed < 0) return;

//elapsed ratio
var ratio = elapsed / me.duration, complete = false, callback;
var ratio = elapsed / me.duration, callback;
ratio = ratio <= 0 ? 0 : ratio >= 1 ? 1 : ratio;
var easeRatio = me.ease ? me.ease(ratio) : ratio;

Expand All @@ -349,7 +349,7 @@ return Class.create(/** @lends Tween.prototype */{
if(ratio < 1e-7){
//repeat complete or not loop
if((me.repeat > 0 && me._repeatCount++ >= me.repeat) || (me.repeat == 0 && !me.loop)){
complete = true;
me.isComplete = true;
}else{
me._startTime = now();
me._pausedTime = 0;
Expand Down

0 comments on commit 2522897

Please sign in to comment.