mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 12:23:53 +00:00
Do not crash on resize when application has not started yet.
This commit is contained in:
parent
dc6c3962d3
commit
9bc8580f99
@ -92,7 +92,9 @@
|
|||||||
function resizeHandler() {
|
function resizeHandler() {
|
||||||
let w = Math.floor(Math.floor(window.innerWidth * window.devicePixelRatio) / window.devicePixelRatio);
|
let w = Math.floor(Math.floor(window.innerWidth * window.devicePixelRatio) / window.devicePixelRatio);
|
||||||
let h = Math.floor(Math.floor(window.innerHeight * window.devicePixelRatio) / window.devicePixelRatio);
|
let h = Math.floor(Math.floor(window.innerHeight * window.devicePixelRatio) / window.devicePixelRatio);
|
||||||
|
if(preloadElement.hidden === true) {
|
||||||
Module.ccall('nativeResize', 'number', ['number', 'number'], [w * window.devicePixelRatio, h * window.devicePixelRatio]);
|
Module.ccall('nativeResize', 'number', ['number', 'number'], [w * window.devicePixelRatio, h * window.devicePixelRatio]);
|
||||||
|
}
|
||||||
Module.canvas.style.width = w + 'px';
|
Module.canvas.style.width = w + 'px';
|
||||||
Module.canvas.style.height = h + 'px';
|
Module.canvas.style.height = h + 'px';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user