mirror of
https://github.com/konvajs/konva.git
synced 2025-12-05 11:27:57 +08:00
prepared transition logic for new easing functions
This commit is contained in:
14
src/Layer.js
14
src/Layer.js
@@ -17,7 +17,7 @@ Kinetic.Layer = function(config) {
|
||||
this.transitions = [];
|
||||
this.transitionIdCounter = 0;
|
||||
this.isTransitioning = false;
|
||||
|
||||
|
||||
// call super constructors
|
||||
Kinetic.Container.apply(this, []);
|
||||
Kinetic.Node.apply(this, [config]);
|
||||
@@ -74,6 +74,18 @@ Kinetic.Layer.prototype = {
|
||||
if(this.visible) {
|
||||
this._drawChildren();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* clear transition if one is running
|
||||
*/
|
||||
_clearTransition: function(shape) {
|
||||
for(var n = 0; n < this.transitions.length; n++) {
|
||||
var transition = this.transitions[n];
|
||||
if(transition.node.id === shape.id) {
|
||||
Kinetic.GlobalObject._removeTransition(transition);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
// Extend Container and Node
|
||||
|
||||
Reference in New Issue
Block a user