Skip to content

Commit e40ea53

Browse files
committed
Fix charts shinking in size on certain Zoom values in Chrome
1 parent b5ee134 commit e40ea53

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/helpers/helpers.dom.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,11 @@ export function retinaScale(
211211
forceStyle?: boolean
212212
): boolean | void {
213213
const pixelRatio = forceRatio || 1;
214-
const deviceHeight = Math.floor(chart.height * pixelRatio);
215-
const deviceWidth = Math.floor(chart.width * pixelRatio);
214+
const deviceHeight = round1(chart.height * pixelRatio);
215+
const deviceWidth = round1(chart.width * pixelRatio);
216216

217-
(chart as PrivateChart).height = Math.floor(chart.height);
218-
(chart as PrivateChart).width = Math.floor(chart.width);
217+
(chart as PrivateChart).height = round1(chart.height);
218+
(chart as PrivateChart).width = round1(chart.width);
219219

220220
const canvas = chart.canvas;
221221

0 commit comments

Comments
 (0)