diff --git a/src/paths/utils.js b/src/paths/utils.js index e2792588..3efb656c 100644 --- a/src/paths/utils.js +++ b/src/paths/utils.js @@ -162,10 +162,10 @@ export function clipGaps(gaps, ori, plotLft, plotTop, plotWid, plotHgt) { if (g[1] > g[0]) { let w = g[0] - prevGapEnd; - - w > 0 && rect(clip, prevGapEnd, plotTop, w, plotTop + plotHgt); - - prevGapEnd = g[1]; + if (w > 0){ + rect(clip, prevGapEnd, plotTop, w, plotTop + plotHgt); + prevGapEnd = g[1]; + } } }