fix: Web build scaling
This commit is contained in:
parent
4d7021ece1
commit
93e5d62782
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user