From 31cc1bdb58708101022c43aba4130f7a7366b337 Mon Sep 17 00:00:00 2001 From: Leonardo Giovanni Scur Date: Fri, 14 Jun 2019 17:37:21 -0300 Subject: Fix pointer position in hidpi-corrected resolutions on web --- misc/dist/html/full-size.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'misc') diff --git a/misc/dist/html/full-size.html b/misc/dist/html/full-size.html index 44b009524c..0e8a41a9fc 100644 --- a/misc/dist/html/full-size.html +++ b/misc/dist/html/full-size.html @@ -162,8 +162,13 @@ $GODOT_HEAD_INCLUDE requestAnimationFrame(animate); function adjustCanvasDimensions() { - canvas.width = innerWidth; - canvas.height = innerHeight; + var scale = window.devicePixelRatio || 1; + var width = window.innerWidth; + var height = window.innerHeight; + canvas.width = width * scale; + canvas.height = height * scale; + canvas.style.width = width + "px"; + canvas.style.height = height + "px"; } animationCallbacks.push(adjustCanvasDimensions); adjustCanvasDimensions(); -- cgit v1.2.3