1
0
mirror of synced 2025-02-08 23:09:36 +01:00

fix: Web build scaling

This commit is contained in:
WerWolv 2025-01-25 20:12:21 +01:00
parent 4d7021ece1
commit 93e5d62782
2 changed files with 7 additions and 8 deletions

View File

@ -638,13 +638,7 @@ namespace hex {
return std::midpoint(xScale, yScale);
}
#elif defined(OS_WEB)
return MAIN_THREAD_EM_ASM_INT({
try {
return window.devicePixelRatio;
} catch (e) {
return 1.0;
}
});
return 1.0F;
#else
return 1.0F;
#endif

View File

@ -484,6 +484,11 @@ namespace hex::init {
meanScale /= hex::ImHexApi::System::getBackingScaleFactor();
// Force native scale factor to 1.0 on web builds
#if defined(OS_WEB)
meanScale = 1.0F;
#endif
ImHexApi::System::impl::setGlobalScale(meanScale);
ImHexApi::System::impl::setNativeScale(meanScale);