From eaab71e242404174479b3539ca1ec499744d864e Mon Sep 17 00:00:00 2001 From: Eric Rowell Date: Sun, 25 Mar 2012 22:58:07 -0700 Subject: [PATCH] added another functional test to cover more transform and drag and drop cases --- tests/js/functionalTests.js | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/tests/js/functionalTests.js b/tests/js/functionalTests.js index 3232abd2..709cb091 100644 --- a/tests/js/functionalTests.js +++ b/tests/js/functionalTests.js @@ -946,9 +946,8 @@ Test.prototype.tests = { layer.on('click', function(evt) { log(evt.shape.getName()); - - }); + }); var redCircle = new Kinetic.Circle({ x: stage.width / 2, y: stage.height / 2, @@ -1029,9 +1028,9 @@ Test.prototype.tests = { layer.add(rect); stage.add(layer); - + //stage.rotateDeg(20); - + //console.log(rect.getAbsoluteTransform().getTranslation()) stage.rotate(Math.PI / 3); @@ -1378,6 +1377,35 @@ Test.prototype.tests = { layer.add(group); 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) { var stage = new Kinetic.Stage({ container: containerId,