Skip to content

Commit

Permalink
impr: Try to detect backing scaling factor on the web build
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Jan 25, 2025
1 parent 1eee31f commit f976988
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/libimhex/source/api/imhex_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,12 +638,13 @@ namespace hex {
return std::midpoint(xScale, yScale);
}
#elif defined(OS_WEB)
return 1.0F;
/*
return EM_ASM_INT({
return window.devicePixelRatio;
return MAIN_THREAD_EM_ASM_INT({
try {
return window.devicePixelRatio;
} catch (e) {
return 1.0;
}
});
*/
#else
return 1.0F;
#endif
Expand Down

0 comments on commit f976988

Please sign in to comment.