From f0b81a88d17ec0d0c686ed2b698f2340a66c4ca7 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sat, 18 Sep 2021 19:28:55 -0400 Subject: [PATCH] Fix screenshots coming out wrong on mobile The device pixel ratio wasn't being respected --- macrovision.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/macrovision.js b/macrovision.js index 825fdcac..d981892d 100644 --- a/macrovision.js +++ b/macrovision.js @@ -1758,6 +1758,7 @@ function testClick(event) { testCtx.resetTransform(); + testCtx.translate(actualW/2, actualH/2); testCtx.rotate(angle); testCtx.translate(-actualW/2, -actualH/2); @@ -4683,6 +4684,7 @@ function renderToCanvas() { ctx.save(); ctx.resetTransform(); + ctx.scale(window.devicePixelRatio, window.devicePixelRatio) ctx.translate(x, y); ctx.rotate(entity.rotation); ctx.drawImage(img, -xSize/2, -ySize/2, xSize, ySize);