From: Evert Timberg Date: Tue, 19 Jan 2016 02:35:35 +0000 (-0500) Subject: Properly begin path before drawing line at edge of scale X-Git-Tag: v2.0.0~63^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1915%2Fhead;p=thirdparty%2FChart.js.git Properly begin path before drawing line at edge of scale --- diff --git a/src/core/core.scale.js b/src/core/core.scale.js index e02e5157b..721ea1f3a 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -661,6 +661,7 @@ x2 += helpers.aliasPixel(this.ctx.lineWidth); } + this.ctx.beginPath(); this.ctx.moveTo(x1, y1); this.ctx.lineTo(x2, y2); this.ctx.stroke(); diff --git a/test/scale.linear.tests.js b/test/scale.linear.tests.js index 2d2cdb3dd..9f093ce68 100644 --- a/test/scale.linear.tests.js +++ b/test/scale.linear.tests.js @@ -1026,6 +1026,9 @@ describe('Linear Scale', function() { }, { "name": "setStrokeStyle", "args": ["rgba(0, 0, 0, 0.1)"] + }, { + "name": "beginPath", + "args": [] }, { "name": "moveTo", "args": [0, 100.5] @@ -1099,6 +1102,9 @@ describe('Linear Scale', function() { }, { "name": "setStrokeStyle", "args": ["rgba(0, 0, 0, 0.1)"] + }, { + "name": "beginPath", + "args": [] }, { "name": "moveTo", "args": [0, 100.5] @@ -1558,6 +1564,9 @@ describe('Linear Scale', function() { }, { "name": "setStrokeStyle", "args": ["rgba(0, 0, 0, 0.1)"] + }, { + "name": "beginPath", + "args": [] }, { "name": "moveTo", "args": [30.5, 0] @@ -1689,6 +1698,9 @@ describe('Linear Scale', function() { }, { "name": "setStrokeStyle", "args": ["rgba(0, 0, 0, 0.1)"] + }, { + "name": "beginPath", + "args": [] }, { "name": "moveTo", "args": [30.5, 0] @@ -1946,6 +1958,9 @@ describe('Linear Scale', function() { }, { "name": "setStrokeStyle", "args": ["rgba(0, 0, 0, 0.1)"] + }, { + "name": "beginPath", + "args": [] }, { "name": "moveTo", "args": [30.5, 0]