diff options
Diffstat (limited to 'js/tools/RotateObject3DTool.js')
-rwxr-xr-x | js/tools/RotateObject3DTool.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/js/tools/RotateObject3DTool.js b/js/tools/RotateObject3DTool.js index 55c9586b..c1ddb286 100755 --- a/js/tools/RotateObject3DTool.js +++ b/js/tools/RotateObject3DTool.js | |||
@@ -61,7 +61,12 @@ exports.RotateObject3DTool = Montage.create(Rotate3DToolBase, { | |||
61 | initializeSnapping : { | 61 | initializeSnapping : { |
62 | value : function(event) | 62 | value : function(event) |
63 | { | 63 | { |
64 | console.log( "initializeSnapping" ); | 64 | // console.log( "initializeSnapping" ); |
65 | |||
66 | var selectedElements = this.application.ninja.selectedElements; | ||
67 | if(this.rotateStage) { | ||
68 | selectedElements = [this.application.ninja.currentDocument.documentRoot]; | ||
69 | } | ||
65 | 70 | ||
66 | this._mouseDownHitRec = null; | 71 | this._mouseDownHitRec = null; |
67 | this._mouseUpHitRec = null; | 72 | this._mouseUpHitRec = null; |
@@ -102,7 +107,7 @@ exports.RotateObject3DTool = Montage.create(Rotate3DToolBase, { | |||
102 | // } | 107 | // } |
103 | // } | 108 | // } |
104 | 109 | ||
105 | if (this._targets) | 110 | if (selectedElements.length) |
106 | { | 111 | { |
107 | var point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, | 112 | var point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, |
108 | new WebKitPoint(event.pageX, event.pageY)); | 113 | new WebKitPoint(event.pageX, event.pageY)); |
@@ -159,7 +164,7 @@ exports.RotateObject3DTool = Montage.create(Rotate3DToolBase, { | |||
159 | 164 | ||
160 | if(!this._dragPlane) | 165 | if(!this._dragPlane) |
161 | { | 166 | { |
162 | if (this._targets.length === 1) | 167 | if (selectedElements.length === 1) |
163 | { | 168 | { |
164 | this._dragPlane = viewUtils.getUnprojectedElementPlane(this._clickedObject); | 169 | this._dragPlane = viewUtils.getUnprojectedElementPlane(this._clickedObject); |
165 | snapManager.setupDragPlaneFromPlane(this._dragPlane); | 170 | snapManager.setupDragPlaneFromPlane(this._dragPlane); |