GUI: Android scaling detection fix
This commit is contained in:
parent
6fbe11696e
commit
1c98975771
|
|
@ -196,11 +196,20 @@ double getScaleFactor(const char* driverHint) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// SDL fallback
|
// 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;
|
float dpiScaleF=96.0f;
|
||||||
if (SDL_GetDisplayDPI(0,&dpiScaleF,NULL,NULL)==0) {
|
if (SDL_GetDisplayDPI(0,&dpiScaleF,NULL,NULL)==0) {
|
||||||
ret=round(dpiScaleF/96.0f);
|
ret=round(dpiScaleF/96.0f);
|
||||||
if (ret<1) ret=1;
|
if (ret<1) ret=1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// couldn't detect scaling factor :<
|
// couldn't detect scaling factor :<
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue