]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Fix zoom reset 2139/head
authorEvert Timberg <evert.timberg@gmail.com>
Wed, 16 Mar 2016 00:03:28 +0000 (20:03 -0400)
committerEvert Timberg <evert.timberg@gmail.com>
Wed, 16 Mar 2016 00:03:28 +0000 (20:03 -0400)
src/core/core.helpers.js

index 37355f00ac3681a7e785470f04892c67b27f36b7..a57cb71af7df0c4227db2b723b6b28bd75714799 100644 (file)
@@ -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) {