From 892c1a28bdd7f774ad2b4e39972a11c90969a6c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 8 Nov 2014 17:26:43 -0800 Subject: [PATCH] Some code clean-up. --- src/basic/Line.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/basic/Line.js b/src/basic/Line.js index 64298abd..3d904df7 100644 --- a/src/basic/Line.js +++ b/src/basic/Line.js @@ -122,7 +122,7 @@ var Line = Base.extend(/** @lends Line# */{ bvx -= bpx; bvy -= bpy; } - var cross = bvy * avx - bvx * avy; + var cross = avx * bvy - avy * bvx; // Avoid divisions by 0, and errors when getting too close to 0 if (!Numerical.isZero(cross)) { var dx = apx - bpx, @@ -131,8 +131,7 @@ var Line = Base.extend(/** @lends Line# */{ tb = (avx * dy - avy * dx) / cross; // Check the ranges of t parameters if the line is not allowed // to extend beyond the definition points. - if ((isInfinite || 0 <= ta && ta <= 1) - && (isInfinite || 0 <= tb && tb <= 1)) + if (isInfinite || 0 <= ta && ta <= 1 && 0 <= tb && tb <= 1) return new Point( apx + ta * avx, apy + ta * avy);