impr: Use heuristic to determine backing scale factor on the web

This commit is contained in:
WerWolv
2025-02-15 22:30:06 +01:00
parent e232a2b33d
commit 54f3bc0262
2 changed files with 12 additions and 2 deletions

View File

@@ -648,7 +648,17 @@ namespace hex {
return std::midpoint(xScale, yScale);
}
#elif defined(OS_WEB)
return 1.0F;
return MAIN_THREAD_EM_ASM_DOUBLE({
try {
if (navigator.platform === "MacIntel") {
return 2.0;
} else {
return 1.0;
}
} catch (e) {
return 1.0;
}
});
#else
return 1.0F;
#endif