mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-23 21:15:11 +00:00
GUI: Android scaling detection fix
This commit is contained in:
parent
6fbe11696e
commit
1c98975771
1 changed files with 9 additions and 0 deletions
|
@ -196,11 +196,20 @@ double getScaleFactor(const char* driverHint) {
|
|||
#endif
|
||||
|
||||
// SDL fallback
|
||||
#ifdef ANDROID
|
||||
float dpiScaleF=192.0f;
|
||||
if (SDL_GetDisplayDPI(0,&dpiScaleF,NULL,NULL)==0) {
|
||||
ret=round(dpiScaleF/192.0f);
|
||||
if (ret<1) ret=1;
|
||||
}
|
||||
|
||||
#else
|
||||
float dpiScaleF=96.0f;
|
||||
if (SDL_GetDisplayDPI(0,&dpiScaleF,NULL,NULL)==0) {
|
||||
ret=round(dpiScaleF/96.0f);
|
||||
if (ret<1) ret=1;
|
||||
}
|
||||
#endif
|
||||
|
||||
// couldn't detect scaling factor :<
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue