mirror of
https://github.com/konvajs/konva.git
synced 2025-11-18 17:21:36 +08:00
Kinetic.Animation constructor now just requires a function and optional node. No more config object
This commit is contained in:
@@ -94,7 +94,7 @@ Test.prototype = {
|
||||
|
||||
// loop through tests
|
||||
for(var key in tests) {
|
||||
if(!testOnlySpecial || key.charAt(0) === '*') {
|
||||
if(key.charAt(0) !== 'x' && (!testOnlySpecial || key.charAt(0) === '*')) {
|
||||
var obj = this.addTestContainer(key);
|
||||
this.counter++;
|
||||
console.log(this.counter + ') ' + key);
|
||||
|
||||
@@ -167,12 +167,9 @@ Test.Modules.MANUAL = {
|
||||
// in ms
|
||||
var centerX = stage.getWidth() / 2 - 100 / 2;
|
||||
|
||||
var anim = new Kinetic.Animation({
|
||||
func: function(frame) {
|
||||
var anim = new Kinetic.Animation(function(frame) {
|
||||
rect.attrs.x = amplitude * Math.sin(frame.time * 2 * Math.PI / period) + centerX;
|
||||
layer.draw();
|
||||
}
|
||||
});
|
||||
}, layer);
|
||||
|
||||
anim.start();
|
||||
|
||||
@@ -1292,12 +1289,10 @@ Test.Modules.MANUAL = {
|
||||
layer.add(group);
|
||||
stage.add(layer);
|
||||
|
||||
var anim = new Kinetic.Animation({
|
||||
func: function() {
|
||||
var anim = new Kinetic.Animation(function() {
|
||||
rect.rotate(0.01);
|
||||
layer.draw();
|
||||
}
|
||||
});
|
||||
|
||||
}, layer);
|
||||
anim.start();
|
||||
},
|
||||
'STAGE - hide stage': function(containerId) {
|
||||
|
||||
@@ -50,13 +50,11 @@ Test.Modules.PERFORMANCE = {
|
||||
// in ms
|
||||
var centerX = stage.getWidth() / 2 - 100 / 2;
|
||||
|
||||
var anim = new Kinetic.Animation({
|
||||
func: function(frame) {
|
||||
var anim = new Kinetic.Animation(function(frame) {
|
||||
rect.attrs.x = amplitude * Math.sin(frame.time * 2 * Math.PI / period) + centerX;
|
||||
layer.draw();
|
||||
|
||||
//console.log(frame.timeDiff)
|
||||
}
|
||||
});
|
||||
}, layer);
|
||||
|
||||
anim.start();
|
||||
|
||||
@@ -67,7 +65,7 @@ Test.Modules.PERFORMANCE = {
|
||||
anim.start();
|
||||
}, 4000);
|
||||
},
|
||||
'*DRAWING - draw 10,000 small circles with tooltips': function(containerId) {
|
||||
'DRAWING - draw 10,000 small circles with tooltips': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
container: containerId,
|
||||
width: 578,
|
||||
|
||||
@@ -29,12 +29,9 @@ Test.Modules.ANIMATION = {
|
||||
// in ms
|
||||
var centerX = stage.getWidth() / 2 - 100 / 2;
|
||||
|
||||
var anim = new Kinetic.Animation({
|
||||
func: function(frame) {
|
||||
rect.setX(amplitude * Math.sin(frame.time * 2 * Math.PI / period) + centerX);
|
||||
layer.draw();
|
||||
}
|
||||
});
|
||||
var anim = new Kinetic.Animation(function(frame) {
|
||||
rect.setX(amplitude * Math.sin(frame.time * 2 * Math.PI / period) + centerX);
|
||||
}, layer);
|
||||
var a = Kinetic.Animation;
|
||||
|
||||
test(a.animations.length === 0, 'should be no animations running');
|
||||
|
||||
@@ -23,12 +23,9 @@ Test.Modules.TRANSITION = {
|
||||
var period = 1000;
|
||||
var centerX = 0;
|
||||
|
||||
var anim = new Kinetic.Animation({
|
||||
func: function(frame) {
|
||||
var anim = new Kinetic.Animation(function(frame) {
|
||||
rect.setX(amplitude * Math.sin(frame.time * 2 * Math.PI / period) + centerX);
|
||||
layer.draw();
|
||||
}
|
||||
});
|
||||
}, layer);
|
||||
|
||||
anim.start();
|
||||
anim.stop();
|
||||
|
||||
Reference in New Issue
Block a user