Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf@nereid.pl>2022-10-18 22:00:20 +0300
committerBartosz Taudul <wolf@nereid.pl>2022-10-18 22:00:20 +0300
commit9bc8580f995b505062d259dfd3087fe6f01678b9 (patch)
tree4d80be68f67ecf026ff93849fb4cdf9b6ced91ef
parentdc6c3962d393d0a71c8be0c17b31911e2ecc4db6 (diff)
Do not crash on resize when application has not started yet.
-rw-r--r--profiler/build/wasm/index.html4
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';
}