diff options
Diffstat (limited to 'js/tools/modifier-tool-base.js')
-rwxr-xr-x | js/tools/modifier-tool-base.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/js/tools/modifier-tool-base.js b/js/tools/modifier-tool-base.js index c772e36c..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; |
@@ -569,7 +571,11 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { | |||
569 | var alignArray = new Array(); | 571 | var alignArray = new Array(); |
570 | snapManager.snapAlignToElementBounds( this._clickedObject, delta, alignArray ); | 572 | snapManager.snapAlignToElementBounds( this._clickedObject, delta, alignArray ); |
571 | if (alignArray.length > 0) | 573 | if (alignArray.length > 0) |
574 | { | ||
575 | alignArray.push( hitRec ); | ||
576 | snapManager.sortHitRecords( alignArray ); | ||
572 | hitRec = alignArray[0]; | 577 | hitRec = alignArray[0]; |
578 | } | ||
573 | } | 579 | } |
574 | } | 580 | } |
575 | 581 | ||