From: Evert Timberg Date: Wed, 16 Mar 2016 00:03:28 +0000 (-0400) Subject: Fix zoom reset X-Git-Tag: v2.0.0~16^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2139%2Fhead;p=thirdparty%2FChart.js.git Fix zoom reset --- diff --git a/src/core/core.helpers.js b/src/core/core.helpers.js index 37355f00a..a57cb71af 100644 --- a/src/core/core.helpers.js +++ b/src/core/core.helpers.js @@ -780,14 +780,14 @@ module.exports = function(Chart) { ctx.canvas.width = width * pixelRatio; ctx.scale(pixelRatio, pixelRatio); - ctx.canvas.style.width = width + 'px'; - ctx.canvas.style.height = height + 'px'; - // Store the device pixel ratio so that we can go backwards in `destroy`. // The devicePixelRatio changes with zoom, so there are no guarantees that it is the same // when destroy is called chart.originalDevicePixelRatio = chart.originalDevicePixelRatio || pixelRatio; } + + ctx.canvas.style.width = width + 'px'; + ctx.canvas.style.height = height + 'px'; }; //-- Canvas methods helpers.clear = function(chart) {