From f8edf5d8a7858fe00e271ba16923baaa3d5cf27b Mon Sep 17 00:00:00 2001 From: iconexperience Date: Mon, 12 Oct 2015 08:42:36 +0200 Subject: [PATCH] Small refactoring in getConvexHull() Make calculations of distances more concise. --- src/path/Curve.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/path/Curve.js b/src/path/Curve.js index d2823b69..6811f153 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -1557,8 +1557,8 @@ new function() { // Scope for intersection using bezier fat-line clipping p2 = [ 2 / 3, dq2 ], p3 = [ 1, dq3 ], // Find vertical signed distance of p1 and p2 from line [p0, p3] - dist1 = dq1 - (dq0 + (dq3 - dq0) / 3), - dist2 = dq2 - (dq0 + 2 * (dq3 - dq0) / 3), + dist1 = dq1 - (2 * dq0 + dq3) / 3, + dist2 = dq2 - (dq0 + 2 * dq3) / 3, hull; // Check if p1 and p2 are on the opposite side of the line [p0, p3] if (dist1 * dist2 < 0) {