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