mirror of
https://github.com/konvajs/konva.git
synced 2025-12-29 18:34:36 +08:00
Call onReset event when Tween resets to beginning
This commit is contained in:
10
src/Tween.js
10
src/Tween.js
@@ -67,6 +67,9 @@
|
||||
}
|
||||
|
||||
this.reset();
|
||||
|
||||
// add Reset event handler after initial reset is fired
|
||||
this.onReset = config.onReset;
|
||||
};
|
||||
|
||||
Kinetic.Tween.tweens = {};
|
||||
@@ -127,6 +130,11 @@
|
||||
that.onFinish();
|
||||
}
|
||||
};
|
||||
tween.onReset = function() {
|
||||
if (that._isLastTween(tween) && that.onReset) {
|
||||
that.onReset();
|
||||
}
|
||||
};
|
||||
},
|
||||
/**
|
||||
* play
|
||||
@@ -559,4 +567,4 @@
|
||||
return c * t / d + b;
|
||||
}
|
||||
};
|
||||
})();
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user