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); return std::midpoint(xScale, yScale);
} }
#elif defined(OS_WEB) #elif defined(OS_WEB)
return MAIN_THREAD_EM_ASM_INT({ return 1.0F;
try {
return window.devicePixelRatio;
} catch (e) {
return 1.0;
}
});
#else #else
return 1.0F; return 1.0F;
#endif #endif

View File

@ -482,7 +482,12 @@ namespace hex::init {
if (meanScale <= 0.0F) if (meanScale <= 0.0F)
meanScale = 1.0F; meanScale = 1.0F;
meanScale /= hex::ImHexApi::System::getBackingScaleFactor(); 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::setGlobalScale(meanScale);
ImHexApi::System::impl::setNativeScale(meanScale); ImHexApi::System::impl::setNativeScale(meanScale);