fix: Scaling on the web version
This commit is contained in:
parent
19f925c60b
commit
73a3b217a4
@ -648,7 +648,13 @@ namespace hex {
|
||||
return std::midpoint(xScale, yScale);
|
||||
}
|
||||
#elif defined(OS_WEB)
|
||||
return 1.0F;
|
||||
return EM_ASM_DOUBLE({
|
||||
try {
|
||||
return window.devicePixelRatio;
|
||||
} catch (e) {
|
||||
return 1.0;
|
||||
}
|
||||
});
|
||||
#else
|
||||
return 1.0F;
|
||||
#endif
|
||||
|
@ -161,8 +161,7 @@ namespace hex {
|
||||
|
||||
const float currScaleFactor = MAIN_THREAD_EM_ASM_DOUBLE({
|
||||
try {
|
||||
// Take square root of scaling to counter scaling applied by Browser
|
||||
return Math.sqrt(window.devicePixelRatio);
|
||||
return window.devicePixelRatio;
|
||||
} catch (e) {
|
||||
return 1.0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user