web: Fix canvas size issues when zooming page

This commit is contained in:
WerWolv
2026-01-04 11:07:02 +01:00
parent 712a125be7
commit 03dd20c263
3 changed files with 7 additions and 5 deletions

View File

@@ -45,6 +45,7 @@ if (EMSCRIPTEN)
target_link_options(main PRIVATE -sEXPORTED_RUNTIME_METHODS=ccall)
target_link_options(main PRIVATE -sFETCH)
target_link_options(main PRIVATE -sASSERTIONS)
target_link_options(main PRIVATE -sNO_DISABLE_EXCEPTION_CATCHING)
target_link_options(main PRIVATE -sWASM_BIGINT)
target_link_options(main PRIVATE -O2)
target_link_options(main PRIVATE -fsanitize=null)

View File

@@ -147,6 +147,7 @@ namespace hex {
prevWidth = width;
prevHeight = height;
this->resize(width, height);
resizeCanvas();
}
}
@@ -167,7 +168,7 @@ namespace hex {
ImHexApi::System::impl::setNativeScale(currScaleFactor);
ThemeManager::reapplyCurrentTheme();
ImGui::GetStyle().ScaleAllSizes(currScaleFactor);
ImGui::GetStyle().ScaleAllSizes(currScaleFactor / prevScaleFactor);
}
prevScaleFactor = currScaleFactor;