1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Fix blur caused by fractional DPI scaling.

This commit is contained in:
Bartosz Taudul
2022-10-15 11:57:17 +02:00
parent 9503280f33
commit 4892c32b40
+5 -3
View File
@@ -90,9 +90,11 @@
var preloadElement = document.getElementById('preload');
function resizeHandler() {
Module.ccall('nativeResize', 'number', ['number', 'number'], [window.innerWidth * window.devicePixelRatio, window.innerHeight * window.devicePixelRatio]);
Module.canvas.style.width = window.innerWidth + 'px';
Module.canvas.style.height = window.innerHeight + 'px';
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]);
Module.canvas.style.width = w + 'px';
Module.canvas.style.height = h + 'px';
}
var Module = {