diff options
Diffstat (limited to 'js/tools/modifier-tool-base.js')
-rwxr-xr-x | js/tools/modifier-tool-base.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/js/tools/modifier-tool-base.js b/js/tools/modifier-tool-base.js index 9b855e66..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; |
@@ -480,7 +482,6 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { | |||
480 | if(this._target) | 482 | if(this._target) |
481 | { | 483 | { |
482 | this.isDrawing = true; | 484 | this.isDrawing = true; |
483 | this.application.ninja.stage.showSelectionBounds = false; | ||
484 | this._updateTargets(); | 485 | this._updateTargets(); |
485 | 486 | ||
486 | if(this._canSnap) | 487 | if(this._canSnap) |
@@ -570,7 +571,11 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { | |||
570 | var alignArray = new Array(); | 571 | var alignArray = new Array(); |
571 | snapManager.snapAlignToElementBounds( this._clickedObject, delta, alignArray ); | 572 | snapManager.snapAlignToElementBounds( this._clickedObject, delta, alignArray ); |
572 | if (alignArray.length > 0) | 573 | if (alignArray.length > 0) |
574 | { | ||
575 | alignArray.push( hitRec ); | ||
576 | snapManager.sortHitRecords( alignArray ); | ||
573 | hitRec = alignArray[0]; | 577 | hitRec = alignArray[0]; |
578 | } | ||
574 | } | 579 | } |
575 | } | 580 | } |
576 | 581 | ||
@@ -798,7 +803,6 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { | |||
798 | if(len === 1) | 803 | if(len === 1) |
799 | { | 804 | { |
800 | this.target = this.application.ninja.selectedElements[0]; | 805 | this.target = this.application.ninja.selectedElements[0]; |
801 | drawUtils.addElement(this.target); | ||
802 | } | 806 | } |
803 | else | 807 | else |
804 | { | 808 | { |
@@ -882,7 +886,6 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { | |||
882 | new WebKitPoint(event.pageX, event.pageY)); | 886 | new WebKitPoint(event.pageX, event.pageY)); |
883 | 887 | ||
884 | this.isDrawing = false; | 888 | this.isDrawing = false; |
885 | this.application.ninja.stage.showSelectionBounds = true; | ||
886 | if(this._escape) { | 889 | if(this._escape) { |
887 | this._escape = false; | 890 | this._escape = false; |
888 | return; | 891 | return; |