aboutsummaryrefslogtreecommitdiff
path: root/js/tools
diff options
context:
space:
mode:
Diffstat (limited to 'js/tools')
-rwxr-xr-xjs/tools/Translate3DToolBase.js4
-rwxr-xr-xjs/tools/TranslateObject3DTool.js19
2 files changed, 10 insertions, 13 deletions
diff --git a/js/tools/Translate3DToolBase.js b/js/tools/Translate3DToolBase.js
index b5008666..fd275a8a 100755
--- a/js/tools/Translate3DToolBase.js
+++ b/js/tools/Translate3DToolBase.js
@@ -166,7 +166,7 @@ exports.Translate3DToolBase = Montage.create(ModifierToolBase,
166 166
167 var len = selectedElements.length, 167 var len = selectedElements.length,
168 self = this, 168 self = this,
169 target = selectedElements[0], 169 target = this.clickedObject,
170 curMat = viewUtils.getMatrixFromElement( target ), 170 curMat = viewUtils.getMatrixFromElement( target ),
171 matInv = glmat4.inverse(this._startMat, []), 171 matInv = glmat4.inverse(this._startMat, []),
172 nMat = glmat4.multiply(transMat, this._startMat, [] ); 172 nMat = glmat4.multiply(transMat, this._startMat, [] );
@@ -180,7 +180,7 @@ exports.Translate3DToolBase = Montage.create(ModifierToolBase,
180 180
181 var shouldUpdateStartMat = true; 181 var shouldUpdateStartMat = true;
182 182
183 if(this._clickedOnStage || ((this._handleMode === 2) && (len > 1))) 183 if(this._clickedOnStage || ((this._handleMode !== null) && (len > 1)))
184 { 184 {
185 shouldUpdateStartMat = false; 185 shouldUpdateStartMat = false;
186 } 186 }
diff --git a/js/tools/TranslateObject3DTool.js b/js/tools/TranslateObject3DTool.js
index a3ece1f9..5dfd2029 100755
--- a/js/tools/TranslateObject3DTool.js
+++ b/js/tools/TranslateObject3DTool.js
@@ -77,15 +77,12 @@ exports.TranslateObject3DTool = Montage.create(Translate3DToolBase, {
77 else 77 else
78 { 78 {
79 this._delta = null; 79 this._delta = null;
80 //if(this._handleMode === 2) { 80 this._dragPlane = viewUtils.getNormalToUnprojectedElementPlane(this._target, this._handleMode, (this._inLocalMode && (this.application.ninja.selectedElements.length === 1)));
81 this._dragPlane = viewUtils.getNormalToUnprojectedElementPlane(this._target, this._handleMode, this._inLocalMode); 81 snapManager.setupDragPlaneFromPlane(this._dragPlane);
82 //console.log( "dragPlane: " + this._dragPlane ); 82 do3DSnap = false;
83 snapManager.setupDragPlaneFromPlane(this._dragPlane); 83
84 do3DSnap = false; 84 snapManager.enableElementSnap ( false );
85 85 snapManager.enableGridSnap ( false );
86 snapManager.enableElementSnap ( false );
87 snapManager.enableGridSnap ( false );
88 //}
89 } 86 }
90 87
91 if(this.application.ninja.selectedElements.length) { 88 if(this.application.ninja.selectedElements.length) {
@@ -95,7 +92,7 @@ exports.TranslateObject3DTool = Montage.create(Translate3DToolBase, {
95 // a snap on the mouse down 92 // a snap on the mouse down
96 var hitRec = snapManager.snap(point.x, point.y, do3DSnap); 93 var hitRec = snapManager.snap(point.x, point.y, do3DSnap);
97 94
98 if(this._handleMode === 2) 95 if(this._handleMode !== null)
99 { 96 {
100 // translate z doesn't snap to element so hitRec's element will always be different 97 // translate z doesn't snap to element so hitRec's element will always be different
101 // from what the browser says we clicked on. So, skip this check. 98 // from what the browser says we clicked on. So, skip this check.
@@ -135,7 +132,7 @@ exports.TranslateObject3DTool = Montage.create(Translate3DToolBase, {
135 snapManager.enableSnapAlign( snapManager.snapAlignEnabledAppLevel() ); 132 snapManager.enableSnapAlign( snapManager.snapAlignEnabledAppLevel() );
136 } 133 }
137 134
138 if(this._handleMode === 2) 135 if(this._handleMode !== null)
139 this.clickedObject = this._target; 136 this.clickedObject = this._target;
140 137
141 // parameterize the snap point on the target 138 // parameterize the snap point on the target