]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Revert "Use round when setting new chart size (#7221)" (#7226)
authorEvert Timberg <evert.timberg+github@gmail.com>
Sat, 28 Mar 2020 00:23:14 +0000 (20:23 -0400)
committerGitHub <noreply@github.com>
Sat, 28 Mar 2020 00:23:14 +0000 (20:23 -0400)
This reverts commit 8b01ab1326be8dead099cdb494e2efdc46ff4dbf.

src/core/core.controller.js

index 03dc499f532697c15cee2c81191f06c3edea31b8..9e3c5fd7a10db4cafa6a3a42992a5ddfd41d8904 100644 (file)
@@ -313,8 +313,8 @@ export default class Chart {
                // the canvas display style uses the same integer values to avoid blurring effect.
 
                // Set to 0 instead of canvas.size because the size defaults to 300x150 if the element is collapsed
-               const newWidth = Math.max(0, Math.round(width));
-               const newHeight = Math.max(0, Math.round(aspectRatio ? newWidth / aspectRatio : height));
+               const newWidth = Math.max(0, Math.floor(width));
+               const newHeight = Math.max(0, Math.floor(aspectRatio ? newWidth / aspectRatio : height));
 
                // detect devicePixelRation changes
                const oldRatio = me.currentDevicePixelRatio;