From 8792d142b3276dc98310be20ce8026f44c69fef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 29 Sep 2018 15:08:19 +0200 Subject: [PATCH] Some code cleanup for #1515 --- src/path/PathItem.Boolean.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/path/PathItem.Boolean.js b/src/path/PathItem.Boolean.js index eba29940..0d6e1c5f 100644 --- a/src/path/PathItem.Boolean.js +++ b/src/path/PathItem.Boolean.js @@ -750,27 +750,24 @@ PathItem.inject(new function() { // first operand. var wind = null; if (operator.subtract && path2) { - // calculate path winding at point depending on operand + // Calculate path winding at point depending on operand. var pathWinding = operand === path1 ? path2._getWinding(pt, dir, true) : path1._getWinding(pt, dir, true); - // if curve should be omitted + // Check if curve should be omitted. if (operand === path1 && pathWinding.winding || operand === path2 && !pathWinding.winding) { - // if quality is not good enough + // Check if quality is not good enough... if (pathWinding.quality < 1) { - // skip this point + // ...and if so, skip this point... continue; } else { - // omit curve - wind = {winding: 0, quality: 1}; + // ...otherwise, omit this curve. + wind = { winding: 0, quality: 1 }; } } } - // default case - if (wind === null) { - wind = getWinding(pt, curves, dir, true); - } + wind = wind || getWinding(pt, curves, dir, true); if (wind.quality > winding.quality) winding = wind; break;