diff options
Diffstat (limited to 'js/tools/drawing-tool-base.js')
-rwxr-xr-x | js/tools/drawing-tool-base.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/js/tools/drawing-tool-base.js b/js/tools/drawing-tool-base.js index 92646894..cb094b85 100755 --- a/js/tools/drawing-tool-base.js +++ b/js/tools/drawing-tool-base.js | |||
@@ -300,7 +300,7 @@ exports.DrawingToolBase = Montage.create(Component, { | |||
300 | s1Offset[1] += snapManager.getStageHeight() / 2.0; | 300 | s1Offset[1] += snapManager.getStageHeight() / 2.0; |
301 | return ({ "width": w, "height": h, "planeMat": planeMat, "midPt": midPt, "mouseDownPos": s0Offset, "mouseUpPos": s1Offset }); | 301 | return ({ "width": w, "height": h, "planeMat": planeMat, "midPt": midPt, "mouseDownPos": s0Offset, "mouseUpPos": s1Offset }); |
302 | } else { | 302 | } else { |
303 | return null | 303 | return null; |
304 | } | 304 | } |
305 | } | 305 | } |
306 | }, | 306 | }, |
@@ -516,7 +516,7 @@ exports.DrawingToolBase = Montage.create(Component, { | |||
516 | value: function( s0In, s1In, planeMat, planeMatInv, fixedS1 ) { | 516 | value: function( s0In, s1In, planeMat, planeMatInv, fixedS1 ) { |
517 | var s0 = s0In.slice(0); | 517 | var s0 = s0In.slice(0); |
518 | var s2 = s1In.slice(0); | 518 | var s2 = s1In.slice(0); |
519 | 519 | var pt0, pt1; | |
520 | 520 | ||
521 | // calculate the mid point of the rectangle | 521 | // calculate the mid point of the rectangle |
522 | var midPt = vecUtils.vecAdd(3, s0, s2); | 522 | var midPt = vecUtils.vecAdd(3, s0, s2); |
@@ -571,7 +571,8 @@ exports.DrawingToolBase = Montage.create(Component, { | |||
571 | { | 571 | { |
572 | p0 = ptArr[0]; p1 = ptArr[1]; p2 = ptArr[2]; p3 = ptArr[3]; | 572 | p0 = ptArr[0]; p1 = ptArr[1]; p2 = ptArr[2]; p3 = ptArr[3]; |
573 | z = p0[2]; | 573 | z = p0[2]; |
574 | var pt0 = p0.slice(0), pt1 = p2.slice(0); | 574 | pt0 = p0.slice(0); |
575 | pt1 = p2.slice(0); | ||
575 | if (p0[0] < p2[0]){ | 576 | if (p0[0] < p2[0]){ |
576 | pt0[0] = Math.max(p0[0],p1[0]); | 577 | pt0[0] = Math.max(p0[0],p1[0]); |
577 | pt1[0] = Math.min(p2[0],p3[0]); | 578 | pt1[0] = Math.min(p2[0],p3[0]); |