mirror of
https://github.com/konvajs/konva.git
synced 2025-11-18 09:07:30 +08:00
Kinetic.Animation is now a class that can be instantiated to better represent animation objects. Rather than creating new animation objects and destroying them each time an animation is started and restarted, the same animation obect is now reused, which should help with performance
This commit is contained in:
@@ -748,7 +748,6 @@ Test.prototype.tests = {
|
||||
|
||||
test(go.tempNodes[circle._id] === undefined, 'circle shouldn\'t be in the temp nodes hash');
|
||||
|
||||
|
||||
},
|
||||
'CONTAINER - remove layer with shape': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
@@ -4500,29 +4499,36 @@ Test.prototype.tests = {
|
||||
layer.draw();
|
||||
});
|
||||
var a = Kinetic.Animation;
|
||||
|
||||
|
||||
test(a.animations.length === 0, 'should be no animations running');
|
||||
test(stage.animRunning === false, 'animRunning should be false');
|
||||
|
||||
stage.start();
|
||||
|
||||
test(a.animations.length === 1, 'should be 1 animation running');
|
||||
test(a.animations[0].id === stage.anim.id, 'animation id is incorrect');
|
||||
test(stage.animRunning === true, 'animRunning should be true');
|
||||
|
||||
stage.stop();
|
||||
test(a.animations.length === 0, 'should be no animations running');
|
||||
test(stage.animRunning === false, 'animRunning should be false');
|
||||
|
||||
stage.start();
|
||||
test(a.animations.length === 1, 'should be 1 animation running');
|
||||
test(a.animations[0].id === stage.anim.id, 'animation id is incorrect');
|
||||
test(stage.animRunning === true, 'animRunning should be true');
|
||||
|
||||
stage.start();
|
||||
|
||||
test(a.animations.length === 1, 'should be 1 animation running');
|
||||
test(a.animations[0].id === stage.anim.id, 'animation id is incorrect');
|
||||
test(stage.animRunning === true, 'animRunning should be true');
|
||||
|
||||
|
||||
stage.stop();
|
||||
|
||||
test(a.animations.length === 0, 'should be no animations running');
|
||||
test(stage.animRunning === false, 'animRunning should be false');
|
||||
|
||||
stage.stop();
|
||||
|
||||
test(a.animations.length === 0, 'should be no animations running');
|
||||
test(stage.animRunning === false, 'animRunning should be false');
|
||||
test(stage.animRunning === false, 'animRunning should be false');
|
||||
},
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// TRANSITION tests
|
||||
|
||||
Reference in New Issue
Block a user