mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-27 23:37:05 -05:00
web: Fix canvas being too big
This commit is contained in:
10
dist/web/source/wasm-config.js
vendored
10
dist/web/source/wasm-config.js
vendored
@@ -271,8 +271,14 @@ function js_resizeCanvas() {
|
||||
|
||||
canvas.top = document.documentElement.clientTop;
|
||||
canvas.left = document.documentElement.clientLeft;
|
||||
canvas.width = Math.min(document.documentElement.clientWidth, window.innerWidth || 0) * window.devicePixelRatio;
|
||||
canvas.height = Math.min(document.documentElement.clientHeight, window.innerHeight || 0) * window.devicePixelRatio;
|
||||
|
||||
let width = Math.min(document.documentElement.clientWidth, window.innerWidth || 0);
|
||||
let height = Math.min(document.documentElement.clientHeight, window.innerHeight || 0);
|
||||
|
||||
canvas.style.width = width + "px";
|
||||
canvas.style.height = height + "px";
|
||||
canvas.width = width * window.devicePixelRatio;
|
||||
canvas.height = height * window.devicePixelRatio;
|
||||
}
|
||||
|
||||
// Prevent some default browser shortcuts from preventing ImHex ones to work
|
||||
|
||||
@@ -513,10 +513,6 @@ namespace hex::init {
|
||||
if (meanScale <= 0.0F)
|
||||
meanScale = 1.0F;
|
||||
|
||||
#if defined(OS_WEB)
|
||||
meanScale = 1.0F;
|
||||
#endif
|
||||
|
||||
#if !defined(OS_LINUX)
|
||||
meanScale /= hex::ImHexApi::System::getBackingScaleFactor();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user