diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-08-29 16:52:04 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-08-29 16:52:04 +0300 |
commit | 88a9376327733a06490bd8322fe18f12a85560bc (patch) | |
tree | a53dfd851003b73458827b0fe4083bece699f304 /src/ui/window.c | |
parent | 9895b10c9cb2d69be718dd3847206e98631dc1c0 (diff) | |
parent | 7ec39c46f2efdbc084beacdfae7b79ba794042b4 (diff) |
Merge branch 'dev' into work/v1.7
Diffstat (limited to 'src/ui/window.c')
-rw-r--r-- | src/ui/window.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/ui/window.c b/src/ui/window.c index 3bafd9a4..3ac02495 100644 --- a/src/ui/window.c +++ b/src/ui/window.c | |||
@@ -278,11 +278,14 @@ static float displayScale_Window_(const iWindow *d) { | |||
278 | iUnused(d); | 278 | iUnused(d); |
279 | return desktopDPI_Win32(); | 279 | return desktopDPI_Win32(); |
280 | #else | 280 | #else |
281 | float vdpi = 0.0f; | 281 | if (isRunningUnderWindowSystem_App()) { |
282 | SDL_GetDisplayDPI(SDL_GetWindowDisplayIndex(d->win), NULL, NULL, &vdpi); | 282 | float vdpi = 0.0f; |
283 | // printf("DPI: %f\n", vdpi); | 283 | SDL_GetDisplayDPI(SDL_GetWindowDisplayIndex(d->win), NULL, NULL, &vdpi); |
284 | const float factor = vdpi / baseDPI_Window / pixelRatio_Window_(d); | 284 | // printf("DPI: %f\n", vdpi); |
285 | return iMax(1.0f, factor); | 285 | const float factor = vdpi / baseDPI_Window / pixelRatio_Window_(d); |
286 | return iMax(1.0f, factor); | ||
287 | } | ||
288 | return 1.0f; | ||
286 | #endif | 289 | #endif |
287 | } | 290 | } |
288 | 291 | ||