Skip to content

Commit

Permalink
fix: Avoid reassigning the the chart size. For specific values of pix…
Browse files Browse the repository at this point in the history
…elRatio the assignment would cause the size to reduce by 1px. Since it's called from the ResizeObserver it will be stuck in a loop that constantly reduce the size of the chart and canvas.
  • Loading branch information
gbaron committed Dec 15, 2022
1 parent bf4fdcf commit ed7a348
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/helpers/helpers.dom.ts
Expand Up @@ -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,
Expand Down

0 comments on commit ed7a348

Please sign in to comment.