mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-27 23:37:05 -05:00
web: Fix canvas size issues when zooming page
This commit is contained in:
8
dist/web/source/wasm-config.js
vendored
8
dist/web/source/wasm-config.js
vendored
@@ -271,11 +271,11 @@ window.addEventListener('resize', js_resizeCanvas, false);
|
||||
function js_resizeCanvas() {
|
||||
let canvas = document.getElementById('canvas');
|
||||
|
||||
canvas.top = document.documentElement.clientTop;
|
||||
canvas.left = document.documentElement.clientLeft;
|
||||
canvas.top = canvas.parentElement.clientTop;
|
||||
canvas.left = canvas.parentElement.clientLeft;
|
||||
|
||||
let width = Math.min(document.documentElement.clientWidth, window.innerWidth || 0);
|
||||
let height = Math.min(document.documentElement.clientHeight, window.innerHeight || 0);
|
||||
let width = Math.min(canvas.parentElement.clientWidth, window.innerWidth || 0);
|
||||
let height = Math.min(canvas.parentElement.clientHeight, window.innerHeight || 0);
|
||||
|
||||
canvas.style.width = width + "px";
|
||||
canvas.style.height = height + "px";
|
||||
|
||||
Reference in New Issue
Block a user