device_android.go 404 B

123456789101112131415161718192021
  1. //go:build android
  2. // +build android
  3. package mobile
  4. import "fyne.io/fyne/v2"
  5. const tapYOffset = -12.0 // to compensate for how we hold our fingers on the device
  6. func (*device) SystemScaleForWindow(_ fyne.Window) float32 {
  7. if currentDPI >= 600 {
  8. return 4
  9. } else if currentDPI >= 405 {
  10. return 3
  11. } else if currentDPI >= 270 {
  12. return 2
  13. } else if currentDPI >= 180 {
  14. return 1.5
  15. }
  16. return 1
  17. }