mirror of
https://github.com/konvajs/konva.git
synced 2025-09-19 10:47:59 +08:00
heavily updated documentation
This commit is contained in:
@@ -169,6 +169,40 @@ Test.Modules.TRANSITION = {
|
||||
layer.add(blueBox);
|
||||
layer.add(redBox);
|
||||
stage.add(layer);
|
||||
},
|
||||
'simple transition': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
container: containerId,
|
||||
width: 578,
|
||||
height: 200
|
||||
});
|
||||
var layer = new Kinetic.Layer();
|
||||
var greenBox = new Kinetic.Rect({
|
||||
x: 50,
|
||||
y: stage.getHeight() / 2 - 25,
|
||||
width: 100,
|
||||
height: 50,
|
||||
fill: 'green',
|
||||
stroke: 'black',
|
||||
strokeWidth: 4,
|
||||
offset: {
|
||||
x: 50,
|
||||
y: 25
|
||||
}
|
||||
});
|
||||
|
||||
layer.add(greenBox);
|
||||
stage.add(layer);
|
||||
|
||||
TweenLite.to(greenBox, 2, {
|
||||
setX: 200,
|
||||
setScaleX: 2,
|
||||
setScaleY: 2,
|
||||
ease: Linear.easeNone,
|
||||
onUpdate: function() {
|
||||
layer.batchDraw();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -93,9 +93,6 @@ Test.Modules.ANIMATION = {
|
||||
|
||||
test(Kinetic.Layer.batchAnim.getLayers().length === 1, 'batch animation should only have one layer');
|
||||
|
||||
// since batch draw is async, we need to test the draw count with a timeout
|
||||
setTimeout(function() {
|
||||
test(draws === 4, 'draw count should be 4');
|
||||
}, 1000);
|
||||
test(draws !== 6, 'should not be 6 draws');
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user