summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-03-09 23:37:34 +0100
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-03-10 00:00:14 +0100
commit3f059b90d61d946b6f5d606c8a306ec71ea305b9 (patch)
tree1ac74f146e395c2155c357ac51a43d5b1dd9283d
parent0bef220f0a7abd5c3b29f9ddbc95e8a7ecf822df (diff)
[HTML5] Properly set canvas size during setup.
It used to be updated before the first iteration, causing the window/viewport size values to be incorrect during the initialization phase (e.g. during the first `_ready` notification).
-rw-r--r--platform/javascript/js/libs/library_godot_display.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/platform/javascript/js/libs/library_godot_display.js b/platform/javascript/js/libs/library_godot_display.js
index b4f1fee4ed..519a50f2db 100644
--- a/platform/javascript/js/libs/library_godot_display.js
+++ b/platform/javascript/js/libs/library_godot_display.js
@@ -805,6 +805,7 @@ const GodotDisplay = {
canvas.style.left = 0;
break;
}
+ GodotDisplayScreen.updateSize();
if (p_fullscreen) {
GodotDisplayScreen.requestFullscreen();
}