From 65abf94675fbd7fddf8b3350efd15507ed3fb76a Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Sat, 30 Jan 2021 11:35:03 +0100 Subject: [HTML5] Better fullscreen, canvas resizing. Three canvas resize policies: - `None`: Godot window settings are ignored. - `Project`: Godot handles the canvas like a native app (resizing it when setting the window size). - `Adaptive`: Canvas size will always adapt to browser window size. Use `None` if you want to control the canvas size with custom JavaScript code. --- misc/dist/html/full-size.html | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'misc') diff --git a/misc/dist/html/full-size.html b/misc/dist/html/full-size.html index c7e657e53d..08912ba860 100644 --- a/misc/dist/html/full-size.html +++ b/misc/dist/html/full-size.html @@ -161,23 +161,6 @@ $GODOT_HEAD_INCLUDE } requestAnimationFrame(animate); - function adjustCanvasDimensions() { - const scale = window.devicePixelRatio || 1; - if (lastWidth != window.innerWidth || lastHeight != window.innerHeight || lastScale != scale) { - lastScale = scale; - lastWidth = window.innerWidth; - lastHeight = window.innerHeight; - canvas.width = Math.floor(lastWidth * scale); - canvas.height = Math.floor(lastHeight * scale); - canvas.style.width = lastWidth + "px"; - canvas.style.height = lastHeight + "px"; - } - } - if (GODOT_CONFIG['canvasResizePolicy'] == 2) { - animationCallbacks.push(adjustCanvasDimensions); - adjustCanvasDimensions(); - } - function setStatusMode(mode) { if (statusMode === mode || !initializing) -- cgit v1.2.3