From: Marcus Lewis Date: Thu, 5 May 2016 03:03:36 +0000 (-0700) Subject: Bugfix: Unwanted drawn point when prevCanvasX is 0 X-Git-Tag: v2.0.0~25^2~1 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=902091b8b33555845682681f64048f7ed1811c27;p=dygraphs.git Bugfix: Unwanted drawn point when prevCanvasX is 0 --- diff --git a/src/dygraph-canvas.js b/src/dygraph-canvas.js index 7ba66ff..bd37e67 100644 --- a/src/dygraph-canvas.js +++ b/src/dygraph-canvas.js @@ -220,18 +220,18 @@ DygraphCanvasRenderer._drawSeries = function(e, prevCanvasX = prevCanvasY = null; } else { isIsolated = false; - if (drawGapPoints || !prevCanvasX) { + if (drawGapPoints || prevCanvasX === null) { iter.nextIdx_ = i; iter.next(); nextCanvasY = iter.hasNext ? iter.peek.canvasy : null; var isNextCanvasYNullOrNaN = nextCanvasY === null || nextCanvasY != nextCanvasY; - isIsolated = (!prevCanvasX && isNextCanvasYNullOrNaN); + isIsolated = (prevCanvasX === null && isNextCanvasYNullOrNaN); if (drawGapPoints) { // Also consider a point to be "isolated" if it's adjacent to a // null point, excluding the graph edges. - if ((!first && !prevCanvasX) || + if ((!first && prevCanvasX === null) || (iter.hasNext && isNextCanvasYNullOrNaN)) { isIsolated = true; }