aboutsummaryrefslogtreecommitdiff
path: root/js/tools/SelectionTool.js
diff options
context:
space:
mode:
authorAnanya Sen2012-05-31 10:13:40 -0700
committerAnanya Sen2012-05-31 10:13:40 -0700
commit286457b4f23974277274ba388afd283e8aa085cb (patch)
treec21bf791e7c4f572d12f97987ea6b89e74da67fe /js/tools/SelectionTool.js
parent4d9b481c58090e8f1fc7b0e9d73a81b0f49cccc8 (diff)
parentd49c909cff7f0c5e5d0b127ad84a2fefc6677dc6 (diff)
downloadninja-286457b4f23974277274ba388afd283e8aa085cb.tar.gz
Merge branch 'refs/heads/ninja-internal-master' into cut-copy-paste
Conflicts: js/controllers/styles-controller.js Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/tools/SelectionTool.js')
-rwxr-xr-xjs/tools/SelectionTool.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js
index 855c7b8c..4bafa12a 100755
--- a/js/tools/SelectionTool.js
+++ b/js/tools/SelectionTool.js
@@ -165,10 +165,11 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, {
165 box[3] = point.y; 165 box[3] = point.y;
166 166
167 //selectionManagerModule.selectionManager.marqueeSelection(box); 167 //selectionManagerModule.selectionManager.marqueeSelection(box);
168 var childNodes = this.application.ninja.currentDocument.documentRoot.childNodes; 168 var childNodes = this.application.ninja.currentDocument.model.documentRoot.childNodes,
169 selectionController = this.application.ninja.selectionController;
169 childNodes = Array.prototype.slice.call(childNodes, 0); 170 childNodes = Array.prototype.slice.call(childNodes, 0);
170 childNodes.forEach(function(item) { 171 childNodes.forEach(function(item) {
171 if(item.nodeType == 1 && SelectionTool._complicatedCollisionDetection(item, box)) { 172 if(selectionController.isNodeTraversable(item) && SelectionTool._complicatedCollisionDetection(item, box)) {
172 selectedItems.push(item); 173 selectedItems.push(item);
173 } 174 }
174 }); 175 });
@@ -223,7 +224,7 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, {
223 if(this.application.ninja.selectedElements.length > 0) { 224 if(this.application.ninja.selectedElements.length > 0) {
224 this.application.ninja.currentSelectedContainer = this.application.ninja.selectedElements[0]; 225 this.application.ninja.currentSelectedContainer = this.application.ninja.selectedElements[0];
225 } else { 226 } else {
226 this.application.ninja.currentSelectedContainer = this.application.ninja.currentDocument.documentRoot; 227 this.application.ninja.currentSelectedContainer = this.application.ninja.currentDocument.model.documentRoot;
227 } 228 }
228 } 229 }
229 }, 230 },
@@ -504,7 +505,7 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, {
504 delta = vecUtils.vecSubtract( 3, data.pt1, data.pt0 ); 505 delta = vecUtils.vecSubtract( 3, data.pt1, data.pt0 );
505 delta[0] = ~~delta[0]; 506 delta[0] = ~~delta[0];
506 delta[1] = ~~delta[1]; 507 delta[1] = ~~delta[1];
507 delta[2] = 0; 508 //delta[2] = 0;
508 var transMat = Matrix.Translation( delta ); 509 var transMat = Matrix.Translation( delta );
509 this._moveElements(transMat); 510 this._moveElements(transMat);
510 } 511 }
@@ -689,7 +690,7 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, {
689 this.application.ninja.stage.clearDrawingCanvas(); 690 this.application.ninja.stage.clearDrawingCanvas();
690 691
691 var item = this._target; 692 var item = this._target;
692 if(!item || (item === this.application.ninja.currentDocument.documentRoot)) 693 if(!item || (item === this.application.ninja.currentDocument.model.documentRoot))
693 { 694 {
694 return; 695 return;
695 } 696 }