aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-03-22 13:07:48 -0700
committerNivesh Rajbhandari2012-03-22 13:07:48 -0700
commit6965b72f1f42f7280bc5e5e52d08b3d64d106831 (patch)
tree459e76b5fc2b54ab05ea34afddd6bc993fcd304c /js
parentbead8ce9e292f030a4b2fba6ad7fd38fb4fe5199 (diff)
downloadninja-6965b72f1f42f7280bc5e5e52d08b3d64d106831.tar.gz
IKNinja-1368 - Moving multiple selection of 2d elements starts changing the objects' relative positions.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js')
-rwxr-xr-xjs/tools/SelectionTool.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js
index e252e36b..aec5b6a3 100755
--- a/js/tools/SelectionTool.js
+++ b/js/tools/SelectionTool.js
@@ -465,11 +465,14 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, {
465 } 465 }
466 else 466 else
467 { 467 {
468 curMat = item.mat.slice(0); 468// curMat = item.mat.slice(0);
469 glmat4.multiply(curMat, qMat, curMat); 469// glmat4.multiply(curMat, qMat, curMat);
470 var previousMat = this._undoArray[i].mat.slice(0); 470// var previousMat = this._undoArray[i].mat.slice(0);
471 var _x = parseInt(ElementsMediator.getProperty(elt, "left")) + curMat[12] - previousMat[12]; 471// var _x = parseInt(ElementsMediator.getProperty(elt, "left")) + curMat[12] - previousMat[12];
472 var _y = parseInt(ElementsMediator.getProperty(elt, "top")) + curMat[13] - previousMat[13]; 472// var _y = parseInt(ElementsMediator.getProperty(elt, "top")) + curMat[13] - previousMat[13];
473
474 var _x = parseInt(ElementsMediator.getProperty(elt, "left")) + transMat[12];
475 var _y = parseInt(ElementsMediator.getProperty(elt, "top")) + transMat[13];
473 476
474 newLeft.push(_x + "px"); 477 newLeft.push(_x + "px");
475 newTop.push(_y + "px"); 478 newTop.push(_y + "px");
@@ -582,6 +585,8 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, {
582 { 585 {
583 // form the translation vector and post translate the matrix by it. 586 // form the translation vector and post translate the matrix by it.
584 delta = vecUtils.vecSubtract( 3, data.pt1, data.pt0 ); 587 delta = vecUtils.vecSubtract( 3, data.pt1, data.pt0 );
588 delta[0] = ~~delta[0];
589 delta[1] = ~~delta[1];
585 delta[2] = 0; 590 delta[2] = 0;
586 var transMat = Matrix.Translation( delta ); 591 var transMat = Matrix.Translation( delta );
587 this._moveElements(transMat); 592 this._moveElements(transMat);