From 8b01ab1326be8dead099cdb494e2efdc46ff4dbf Mon Sep 17 00:00:00 2001 From: emmcbd <42184090+emmcbd@users.noreply.github.com> Date: Sat, 28 Mar 2020 00:46:34 +0100 Subject: [PATCH] Use round when setting new chart size (#7221) --- src/core/core.controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/core.controller.js b/src/core/core.controller.js index 9e3c5fd7a..03dc499f5 100644 --- a/src/core/core.controller.js +++ b/src/core/core.controller.js @@ -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.floor(width)); - const newHeight = Math.max(0, Math.floor(aspectRatio ? newWidth / aspectRatio : height)); + const newWidth = Math.max(0, Math.round(width)); + const newHeight = Math.max(0, Math.round(aspectRatio ? newWidth / aspectRatio : height)); // detect devicePixelRation changes const oldRatio = me.currentDevicePixelRatio; -- 2.47.2