From 3781aedb227393e1080201c69544729ee1763e70 Mon Sep 17 00:00:00 2001 From: hkrish Date: Sat, 3 Jan 2015 23:41:47 +0100 Subject: [PATCH] Small but critical fix on getSignedDistance method when the line is perfectly vertical, return the difference between x values depending on the side. The earlier "l1y" is a silly mistake. --- src/path/Curve.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/path/Curve.js b/src/path/Curve.js index b500849d..a59930b1 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -1192,7 +1192,7 @@ new function() { // Scope for methods that require numerical integration var vx = l2x - l1x, vy = l2y - l1y; if (Numerical.isZero(vx)) - return vy >= 0 ? l1y - x : x - l1x; + return vy >= 0 ? l1x - x : x - l1x; var m = vy / vx, // slope b = l1y - m * l1x; // y offset // Distance to the linear equation