diff options
Diffstat (limited to 'js/tools/TranslateObject3DTool.js')
-rwxr-xr-x | js/tools/TranslateObject3DTool.js | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/js/tools/TranslateObject3DTool.js b/js/tools/TranslateObject3DTool.js index 7c16df5d..72a55322 100755 --- a/js/tools/TranslateObject3DTool.js +++ b/js/tools/TranslateObject3DTool.js | |||
@@ -66,10 +66,8 @@ exports.TranslateObject3DTool = Montage.create(Translate3DToolBase, { | |||
66 | } | 66 | } |
67 | } | 67 | } |
68 | 68 | ||
69 | if(this._targets) | 69 | if(this.application.ninja.selectedElements.length) { |
70 | { | 70 | var point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(event.pageX, event.pageY)); |
71 | var point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, | ||
72 | new WebKitPoint(event.pageX, event.pageY)); | ||
73 | 71 | ||
74 | // do the snap before setting up the avoid list to allow | 72 | // do the snap before setting up the avoid list to allow |
75 | // a snap on the mouse down | 73 | // a snap on the mouse down |
@@ -97,11 +95,10 @@ exports.TranslateObject3DTool = Montage.create(Translate3DToolBase, { | |||
97 | } | 95 | } |
98 | 96 | ||
99 | // we don't want to snap to selected objects during the drag | 97 | // we don't want to snap to selected objects during the drag |
100 | var len = this._targets.length; | 98 | this.application.ninja.selectedElements.forEach(function(element) { |
101 | for(var i=0; i<len; i++) | 99 | snapManager.addToAvoidList(element); |
102 | { | 100 | }); |
103 | snapManager.addToAvoidList( this._targets[i].elt ); | 101 | |
104 | } | ||
105 | if (hitRec) | 102 | if (hitRec) |
106 | { | 103 | { |
107 | // disable snap attributes | 104 | // disable snap attributes |
@@ -123,7 +120,7 @@ exports.TranslateObject3DTool = Montage.create(Translate3DToolBase, { | |||
123 | 120 | ||
124 | if(!this._dragPlane) | 121 | if(!this._dragPlane) |
125 | { | 122 | { |
126 | if( this._inLocalMode && (this._targets.length === 1) ) | 123 | if( this._inLocalMode && (this.application.ninja.selectedElements.length === 1) ) |
127 | { | 124 | { |
128 | this._dragPlane = viewUtils.getUnprojectedElementPlane(this._clickedObject); | 125 | this._dragPlane = viewUtils.getUnprojectedElementPlane(this._clickedObject); |
129 | snapManager.setupDragPlaneFromPlane(this._dragPlane); | 126 | snapManager.setupDragPlaneFromPlane(this._dragPlane); |