Rearranged DPI calc so that on calc failure, returns 1. (#547)
This commit is contained in:
parent
ed3ea35ed5
commit
6aa316e3c3
11
src/main.c
11
src/main.c
|
@ -18,13 +18,12 @@
|
||||||
SDL_Window *window;
|
SDL_Window *window;
|
||||||
|
|
||||||
static double get_scale(void) {
|
static double get_scale(void) {
|
||||||
#ifdef __APPLE__
|
#ifndef __APPLE__
|
||||||
return 1.0;
|
float dpi;
|
||||||
#else
|
if (SDL_GetDisplayDPI(0, NULL, &dpi, NULL) == 0)
|
||||||
float dpi = 96.0;
|
return dpi / 96.0;
|
||||||
SDL_GetDisplayDPI(0, NULL, &dpi, NULL);
|
|
||||||
return dpi / 96.0;
|
|
||||||
#endif
|
#endif
|
||||||
|
return 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue