mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Use round when setting new chart size (#7221)
This commit is contained in:
parent
60858547ac
commit
8b01ab1326
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user