diff options
author | Bartosz Taudul <wolf@nereid.pl> | 2022-10-18 22:00:20 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf@nereid.pl> | 2022-10-18 22:00:20 +0300 |
commit | 9bc8580f995b505062d259dfd3087fe6f01678b9 (patch) | |
tree | 4d80be68f67ecf026ff93849fb4cdf9b6ced91ef | |
parent | dc6c3962d393d0a71c8be0c17b31911e2ecc4db6 (diff) |
Do not crash on resize when application has not started yet.
-rw-r--r-- | profiler/build/wasm/index.html | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/profiler/build/wasm/index.html b/profiler/build/wasm/index.html index 2246823b..fc5baf50 100644 --- a/profiler/build/wasm/index.html +++ b/profiler/build/wasm/index.html @@ -92,7 +92,9 @@ function resizeHandler() { let w = Math.floor(Math.floor(window.innerWidth * window.devicePixelRatio) / window.devicePixelRatio); let h = Math.floor(Math.floor(window.innerHeight * window.devicePixelRatio) / window.devicePixelRatio); - Module.ccall('nativeResize', 'number', ['number', 'number'], [w * window.devicePixelRatio, h * window.devicePixelRatio]); + if(preloadElement.hidden === true) { + Module.ccall('nativeResize', 'number', ['number', 'number'], [w * window.devicePixelRatio, h * window.devicePixelRatio]); + } Module.canvas.style.width = w + 'px'; Module.canvas.style.height = h + 'px'; } |