mirror of
https://github.com/konvajs/konva.git
synced 2026-03-03 16:58:33 +08:00
fixed small bug related to animations - if you called .start() multiple times, multiple animation instances would be created. This wasn't desirable. Also beefed up animation unit tests
This commit is contained in:
12
dist/kinetic-core.js
vendored
12
dist/kinetic-core.js
vendored
@@ -1306,9 +1306,12 @@ Kinetic.Stage.prototype = {
|
||||
* start animation
|
||||
*/
|
||||
start: function() {
|
||||
var go = Kinetic.GlobalObject;
|
||||
go._addAnimation(this.anim);
|
||||
go._handleAnimation();
|
||||
if(!this.animRunning) {
|
||||
var go = Kinetic.GlobalObject;
|
||||
go._addAnimation(this.anim);
|
||||
go._handleAnimation();
|
||||
this.animRunning = true;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* stop animation
|
||||
@@ -1316,7 +1319,7 @@ Kinetic.Stage.prototype = {
|
||||
stop: function() {
|
||||
var go = Kinetic.GlobalObject;
|
||||
go._removeAnimation(this.anim);
|
||||
go._handleAnimation();
|
||||
this.animRunning = false;
|
||||
},
|
||||
/**
|
||||
* draw children
|
||||
@@ -2149,6 +2152,7 @@ Kinetic.Stage.prototype = {
|
||||
this.ids = {};
|
||||
this.names = {};
|
||||
this.anim = undefined;
|
||||
this.animRunning = false;
|
||||
}
|
||||
};
|
||||
// Extend Container and Node
|
||||
|
||||
4
dist/kinetic-core.min.js
vendored
4
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user