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-15 12:57:17 +0300
committerBartosz Taudul <wolf@nereid.pl>2022-10-15 12:57:17 +0300
commit4892c32b40003c17294e66835d1741181d70790b (patch)
tree6d446f9d7d7233e113d9de5b46b4dff7820cf818
parent9503280f33fc013f4432976b62b0a6e3c8595963 (diff)
Fix blur caused by fractional DPI scaling.
-rw-r--r--profiler/build/wasm/index.html8
1 files changed, 5 insertions, 3 deletions
diff --git a/profiler/build/wasm/index.html b/profiler/build/wasm/index.html
index 6525add5..2246823b 100644
--- a/profiler/build/wasm/index.html
+++ b/profiler/build/wasm/index.html
@@ -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 = {