From 1b343d53478c7582075552fe803507aec9dafaa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 6 Oct 2015 16:31:30 +0200 Subject: [PATCH] Rewrite 04cab797dbbe219a40a3fd7180fc278696c5b404 to only use one return statement. --- src/path/Curve.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/path/Curve.js b/src/path/Curve.js index b6050361..19d66f6c 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -1593,10 +1593,10 @@ 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 (qy == threshold) { - return qx; - } else if (top ? qy > threshold : qy < threshold) - return px + (threshold - py) * (qx - px) / (qy - py); + if (top ? qy >= threshold : qy <= threshold) { + return qy === threshold ? qx + : px + (threshold - py) * (qx - px) / (qy - py); + } px = qx; py = qy; }