Skip to content

Commit

Permalink
Fix initial scale factor value for wasm builds
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Dec 8, 2024
1 parent cc35a95 commit 4513981
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions distrho/src/DistrhoUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
# include <stdint.h>
#endif

#if defined(DISTRHO_OS_WINDOWS)
#if defined(DISTRHO_OS_WASM)
# include <emscripten/emscripten.h>
#elif defined(DISTRHO_OS_WINDOWS)
# include <winsock2.h>
# include <windows.h>
#elif defined(HAVE_X11)
Expand Down Expand Up @@ -94,7 +96,9 @@ static double getDesktopScaleFactor(const uintptr_t parentWindowHandle)
if (const char* const scale = getenv("DPF_SCALE_FACTOR"))
return std::max(1.0, std::atof(scale));

#if defined(DISTRHO_OS_WINDOWS)
#if defined(DISTRHO_OS_WASM)
return emscripten_get_device_pixel_ratio();
#elif defined(DISTRHO_OS_WINDOWS)
if (const HMODULE Shcore = LoadLibraryA("Shcore.dll"))
{
typedef HRESULT(WINAPI* PFN_GetProcessDpiAwareness)(HANDLE, DWORD*);
Expand Down

0 comments on commit 4513981

Please sign in to comment.