From 5a6e3d8410ce7a53f6a1b995a3ecb0213496b7b8 Mon Sep 17 00:00:00 2001 From: Cody Seibert Date: Tue, 5 Nov 2024 09:20:20 -0500 Subject: [PATCH] add back pixel ratio --- lib/prepareCanvas.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/prepareCanvas.ts b/lib/prepareCanvas.ts index c3fa3a0..6a6bb96 100644 --- a/lib/prepareCanvas.ts +++ b/lib/prepareCanvas.ts @@ -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; }