mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Fix pointer position in hidpi-corrected resolutions on web
This commit is contained in:
9
misc/dist/html/full-size.html
vendored
9
misc/dist/html/full-size.html
vendored
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user