From e73fba18b095f0c270f5d954e5993c155b488c73 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Fri, 27 Apr 2012 13:52:40 -0700 Subject: Creating shapes in a container --- js/tools/SelectionTool.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'js/tools/SelectionTool.js') diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js index 7033ee3d..9c9aee93 100755 --- a/js/tools/SelectionTool.js +++ b/js/tools/SelectionTool.js @@ -222,8 +222,10 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, { value: function(event) { if(this.application.ninja.selectedElements.length > 0) { this.application.ninja.currentSelectedContainer = this.application.ninja.selectedElements[0]; + console.log( "setting container to selected element" ); } else { this.application.ninja.currentSelectedContainer = this.application.ninja.currentDocument.documentRoot; + console.log( "setting container to stage" ); } } }, -- cgit v1.2.3 From 9c8fbdd11fdbe9ae73d57147de84b799c5a87652 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Mon, 30 Apr 2012 16:15:47 -0700 Subject: Squashed commit of stage architecture Signed-off-by: Valerio Virgillito --- js/tools/SelectionTool.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/tools/SelectionTool.js') diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js index 9c9aee93..f7b583b5 100755 --- a/js/tools/SelectionTool.js +++ b/js/tools/SelectionTool.js @@ -753,10 +753,10 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, { var zoomFactor = 1; var viewPort = this.application.ninja.stage._viewport; - if (viewPort.style && viewPort.style.zoom) - { + if (viewPort && viewPort.style && viewPort.style.zoom) { zoomFactor = Number(viewPort.style.zoom); } + var tmpMat = viewUtils.getLocalToGlobalMatrix( item ); for (var j=0; j<4; j++) { @@ -865,7 +865,7 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, { var zoomFactor = 1; var viewPort = this.application.ninja.stage._viewport; - if (viewPort.style && viewPort.style.zoom) + if (viewPort && viewPort.style && viewPort.style.zoom) { zoomFactor = Number(viewPort.style.zoom); } -- cgit v1.2.3 From fb47c04b0a4d65f53d975311754aa0dd8a8a3f69 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Mon, 30 Apr 2012 16:31:37 -0700 Subject: Removing some console logs Signed-off-by: Valerio Virgillito --- js/tools/SelectionTool.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'js/tools/SelectionTool.js') diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js index f7b583b5..855c7b8c 100755 --- a/js/tools/SelectionTool.js +++ b/js/tools/SelectionTool.js @@ -222,10 +222,8 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, { value: function(event) { if(this.application.ninja.selectedElements.length > 0) { this.application.ninja.currentSelectedContainer = this.application.ninja.selectedElements[0]; - console.log( "setting container to selected element" ); } else { this.application.ninja.currentSelectedContainer = this.application.ninja.currentDocument.documentRoot; - console.log( "setting container to stage" ); } } }, -- cgit v1.2.3