mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 00:36:20 +08:00
added another functional test to cover more transform and drag and drop cases
This commit is contained in:
parent
1f41e931b9
commit
eaab71e242
@ -948,7 +948,6 @@ Test.prototype.tests = {
|
|||||||
log(evt.shape.getName());
|
log(evt.shape.getName());
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var redCircle = new Kinetic.Circle({
|
var redCircle = new Kinetic.Circle({
|
||||||
x: stage.width / 2,
|
x: stage.width / 2,
|
||||||
y: stage.height / 2,
|
y: stage.height / 2,
|
||||||
@ -1378,6 +1377,35 @@ Test.prototype.tests = {
|
|||||||
layer.add(group);
|
layer.add(group);
|
||||||
stage.add(layer);
|
stage.add(layer);
|
||||||
},
|
},
|
||||||
|
'DRAG AND DROP - translate, rotate, and scale shape, and then drag and drop': function(containerId) {
|
||||||
|
var stage = new Kinetic.Stage({
|
||||||
|
container: containerId,
|
||||||
|
width: 578,
|
||||||
|
height: 200
|
||||||
|
});
|
||||||
|
var layer = new Kinetic.Layer();
|
||||||
|
var group = new Kinetic.Group();
|
||||||
|
|
||||||
|
var rect = new Kinetic.Rect({
|
||||||
|
x: 200,
|
||||||
|
y: 100,
|
||||||
|
width: 100,
|
||||||
|
height: 50,
|
||||||
|
fill: 'red',
|
||||||
|
stroke: 'black',
|
||||||
|
strokeWidth: 4,
|
||||||
|
draggable: true,
|
||||||
|
rotationDeg: 60,
|
||||||
|
scale: {
|
||||||
|
x: 2,
|
||||||
|
y: 1
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
group.add(rect);
|
||||||
|
layer.add(group);
|
||||||
|
stage.add(layer);
|
||||||
|
},
|
||||||
'STAGE - save image as png (click on circle to open new window)': function(containerId) {
|
'STAGE - save image as png (click on circle to open new window)': function(containerId) {
|
||||||
var stage = new Kinetic.Stage({
|
var stage = new Kinetic.Stage({
|
||||||
container: containerId,
|
container: containerId,
|
||||||
|
Loading…
Reference in New Issue
Block a user