diff options
author | Leonardo Giovanni Scur <leonardo.scur@dotgroup.com.br> | 2019-06-14 17:37:21 -0300 |
---|---|---|
committer | Leonardo Giovanni Scur <leonardo.scur@dotgroup.com.br> | 2019-06-14 17:37:21 -0300 |
commit | 31cc1bdb58708101022c43aba4130f7a7366b337 (patch) | |
tree | 81c115b0c1b517699136e58ee003c346941347bb /misc | |
parent | 0b555fc70af3c717665934c95070aa6aa481679f (diff) |
Fix pointer position in hidpi-corrected resolutions on web
Diffstat (limited to 'misc')
-rw-r--r-- | misc/dist/html/full-size.html | 9 |
1 files changed, 7 insertions, 2 deletions
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(); |