From: etimberg Date: Tue, 19 May 2015 00:59:21 +0000 (-0400) Subject: Fix a drawing bug when drawTicks is false. X-Git-Tag: v2.0-alpha~8^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b8c9bc30d9137bc375c3527c8742036ed524377;p=thirdparty%2FChart.js.git Fix a drawing bug when drawTicks is false. --- diff --git a/samples/scatter-multi-axis.html b/samples/scatter-multi-axis.html index 8d4658471..30473a1ad 100644 --- a/samples/scatter-multi-axis.html +++ b/samples/scatter-multi-axis.html @@ -95,6 +95,7 @@ hoverMode: 'single', scales: { xAxes: [{ + position: "bottom", gridLines: { zeroLineColor: "rgba(0,0,0,1)" } diff --git a/src/Chart.Scale.js b/src/Chart.Scale.js index 3707597b6..96897f671 100644 --- a/src/Chart.Scale.js +++ b/src/Chart.Scale.js @@ -538,8 +538,9 @@ xValue += helpers.aliasPixel(this.ctx.lineWidth); // Draw the label area - if (this.options.gridLines.drawTicks) { - this.ctx.beginPath(); + this.ctx.beginPath(); + + if (this.options.gridLines.drawTicks) { this.ctx.moveTo(xValue, yTickStart); this.ctx.lineTo(xValue, yTickEnd); } @@ -604,8 +605,9 @@ yValue += helpers.aliasPixel(this.ctx.lineWidth); // Draw the label area + this.ctx.beginPath(); + if (this.options.gridLines.drawTicks) { - this.ctx.beginPath(); this.ctx.moveTo(xTickStart, yValue); this.ctx.lineTo(xTickEnd, yValue); }