From 04cab797dbbe219a40a3fd7180fc278696c5b404 Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 6 Oct 2015 15:25:40 +0200 Subject: [PATCH] Improve clipConvexHullPart() Separately handle special cases --- src/path/Curve.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/path/Curve.js b/src/path/Curve.js index 00d8dcc1..53358912 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -1609,7 +1609,9 @@ new function() { // Scope for intersection using bezier fat-line clipping for (var i = 1, l = part.length; i < l; i++) { var qx = part[i][0], qy = part[i][1]; - if (top ? qy >= threshold : qy <= threshold) + if (qy == threshold) { + return qx; + } else if (top ? qy > threshold : qy < threshold) return px + (threshold - py) * (qx - px) / (qy - py); px = qx; py = qy;