Skip to content

Commit

Permalink
add back pixel ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
webdevcody committed Nov 5, 2024
1 parent 0011c12 commit 5a6e3d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/prepareCanvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export function prepareCanvas(
throw new Error("Unable to get 2d context");
}

canvas.height = height;
canvas.width = width;
canvas.height = height * window.devicePixelRatio;
canvas.width = width * window.devicePixelRatio;
canvas.style.height = `${height}px`;
canvas.style.width = `${width}px`;

// ctx.scale(window.devicePixelRatio, window.devicePixelRatio);
ctx.scale(window.devicePixelRatio, window.devicePixelRatio);
return ctx;
}

0 comments on commit 5a6e3d8

Please sign in to comment.