aboutsummaryrefslogtreecommitdiff
path: root/js/tools/modifier-tool-base.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tools/modifier-tool-base.js')
-rwxr-xr-xjs/tools/modifier-tool-base.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/js/tools/modifier-tool-base.js b/js/tools/modifier-tool-base.js
index d12ba7d2..18a08b5a 100755
--- a/js/tools/modifier-tool-base.js
+++ b/js/tools/modifier-tool-base.js
@@ -200,7 +200,7 @@ exports.ModifierToolBase = Montage.create(DrawingTool, {
200 200
201 // only do quadrant snapping if the 4 corners of the element are in the drag plane 201 // only do quadrant snapping if the 4 corners of the element are in the drag plane
202 var sign = MathUtils.fpSign( vecUtils.vecDot(3,this._dragPlane,[0,0,1]) + this._dragPlane[3] - 1.0); 202 var sign = MathUtils.fpSign( vecUtils.vecDot(3,this._dragPlane,[0,0,1]) + this._dragPlane[3] - 1.0);
203 this._shouldUseQuadPt = (sign == 0) 203 this._shouldUseQuadPt = (sign === 0);
204 204
205 var wpHitRec = hitRec.convertToWorkingPlane( this._dragPlane ); 205 var wpHitRec = hitRec.convertToWorkingPlane( this._dragPlane );
206 this._mouseDownHitRec = wpHitRec; 206 this._mouseDownHitRec = wpHitRec;
@@ -252,10 +252,12 @@ exports.ModifierToolBase = Montage.create(DrawingTool, {
252 y0 = bounds[0][1], y1 = bounds[1][1]; 252 y0 = bounds[0][1], y1 = bounds[1][1];
253 var dx = x1 - x0, dy = y1 - y0; 253 var dx = x1 - x0, dy = y1 - y0;
254 var u = 0, v = 0; 254 var u = 0, v = 0;
255 if (MathUtils.fpSign(dx) != 0) 255 if (MathUtils.fpSign(dx) !== 0) {
256 u = (scrPt[0] - x0) / dx; 256 u = (scrPt[0] - x0) / dx;
257 if (MathUtils.fpSign(dy) != 0) 257 }
258 if (MathUtils.fpSign(dy) !== 0) {
258 v = (scrPt[1] - y0) / dy; 259 v = (scrPt[1] - y0) / dy;
260 }
259 261
260 paramPt[0] = u; 262 paramPt[0] = u;
261 paramPt[1] = v; 263 paramPt[1] = v;