mirror of
https://github.com/konvajs/konva.git
synced 2025-12-04 19:08:24 +08:00
round 1 of animation + transition rewrite, while combing Xaric's Tween port
This commit is contained in:
12
src/Stage.js
12
src/Stage.js
@@ -50,10 +50,6 @@ Kinetic.Stage = function(config) {
|
||||
// set stage id
|
||||
this.id = Kinetic.GlobalObject.idCounter++;
|
||||
|
||||
// animation support
|
||||
this.isAnimating = false;
|
||||
this.onFrameFunc = undefined;
|
||||
|
||||
this._buildDOM();
|
||||
this._listen();
|
||||
this._prepareDrag();
|
||||
@@ -74,20 +70,22 @@ Kinetic.Stage.prototype = {
|
||||
* @param {function} func
|
||||
*/
|
||||
onFrame: function(func) {
|
||||
this.onFrameFunc = func;
|
||||
var go = Kinetic.GlobalObject;
|
||||
go.animations.push({
|
||||
id: go.animIdCounter++,
|
||||
func: func
|
||||
});
|
||||
},
|
||||
/**
|
||||
* start animation
|
||||
*/
|
||||
start: function() {
|
||||
this.isAnimating = true;
|
||||
Kinetic.GlobalObject._handleAnimation();
|
||||
},
|
||||
/**
|
||||
* stop animation
|
||||
*/
|
||||
stop: function() {
|
||||
this.isAnimating = false;
|
||||
Kinetic.GlobalObject._handleAnimation();
|
||||
},
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user