aboutsummaryrefslogtreecommitdiff
path: root/js/tools/modifier-tool-base.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-07-24 00:32:18 -0700
committerValerio Virgillito2012-07-24 00:32:18 -0700
commit2222e73faee8326e4d5be276bc8486316d83f2a6 (patch)
treef9aa990bd281da9543fd42231cfb76a2e1040243 /js/tools/modifier-tool-base.js
parent3f7a5c3482ddb4e7a1b222df314dbc6baf59bb44 (diff)
parent55a69aeb3c66b533d5a2d27d7548471c2c8b5dfc (diff)
downloadninja-2222e73faee8326e4d5be276bc8486316d83f2a6.tar.gz
Merge branch 'jshint' of https://github.com/mencio/ninja into v0.7.1
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;