Browse Source

CP - Limit pixel density fudge to Android only

QGC4.4
Gus Grubba 7 years ago committed by Gus Grubba
parent
commit
c1da073b84
  1. 10
      src/QmlControls/ScreenTools.qml

10
src/QmlControls/ScreenTools.qml

@ -58,18 +58,14 @@ Item {
if(QGroundControl.corePlugin.options.devicePixelDensity != 0) { if(QGroundControl.corePlugin.options.devicePixelDensity != 0) {
return QGroundControl.corePlugin.options.devicePixelDensity return QGroundControl.corePlugin.options.devicePixelDensity
} }
//-- Apple returns proper values //-- Android is rather unreliable
if(isiOS || isMac) { if(isAndroid) {
return Screen.pixelDensity
}
//-- Mobile is rather unreliable
if(isMobile) {
// Lets assume it's unlikely you have a tablet over 300mm wide // Lets assume it's unlikely you have a tablet over 300mm wide
if((Screen.width / Screen.pixelDensity) > 300) { if((Screen.width / Screen.pixelDensity) > 300) {
return Screen.pixelDensity * 2 return Screen.pixelDensity * 2
} }
} }
//-- Still needs logical pixel density on Windows //-- Let's use what the system tells us
return Screen.pixelDensity return Screen.pixelDensity
} }

Loading…
Cancel
Save