From 7e10dcb05a240c0316cc2cdf9777e8a33c92b208 Mon Sep 17 00:00:00 2001 From: artem Date: Sat, 13 Jan 2024 12:34:00 +0300 Subject: [PATCH] width and height taking into account devicePixelRatio --- executor-wasm/index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/executor-wasm/index.html b/executor-wasm/index.html index 4c89676..c9ada3a 100644 --- a/executor-wasm/index.html +++ b/executor-wasm/index.html @@ -35,8 +35,10 @@ function resize(canvasObj) { canvasObj.style = null; - canvasObj.width = window.screen.width; - canvasObj.height = window.screen.height; + canvasObj.width = window.screen.width * window.devicePixelRatio; + canvasObj.height = window.screen.height * window.devicePixelRatio; + canvasObj.style.width = window.screen.width + "px"; + canvasObj.style.height = window.screen.widheightth + "px"; }