diff --git a/src/core/core.controller.js b/src/core/core.controller.js index 2ba26c9f3..7d7bc125b 100644 --- a/src/core/core.controller.js +++ b/src/core/core.controller.js @@ -295,8 +295,8 @@ class Chart { const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio(); const mode = this.width ? 'resize' : 'attach'; - this.width = newSize.width; - this.height = newSize.height; + this.width = Math.floor(newSize.width); + this.height = Math.floor(newSize.height); this._aspectRatio = this.aspectRatio; if (!retinaScale(this, newRatio, true)) { return; diff --git a/src/helpers/helpers.dom.ts b/src/helpers/helpers.dom.ts index ce1d1a045..b4d976864 100644 --- a/src/helpers/helpers.dom.ts +++ b/src/helpers/helpers.dom.ts @@ -222,9 +222,6 @@ export function retinaScale( const deviceHeight = Math.floor(chart.height * pixelRatio); const deviceWidth = Math.floor(chart.width * pixelRatio); - chart.height = deviceHeight / pixelRatio; - chart.width = deviceWidth / pixelRatio; - const canvas = chart.canvas; // If no style has been set on the canvas, the render size is used as display size,