device_desktop.go 436 B

1234567891011121314151617181920212223242526
  1. //go:build !js && !wasm
  2. // +build !js,!wasm
  3. package glfw
  4. import (
  5. "runtime"
  6. "fyne.io/fyne/v2"
  7. )
  8. func (*glDevice) IsMobile() bool {
  9. return false
  10. }
  11. func (*glDevice) SystemScaleForWindow(w fyne.Window) float32 {
  12. if runtime.GOOS == "darwin" {
  13. return 1.0 // macOS scaling is done at the texture level
  14. }
  15. if runtime.GOOS == "windows" {
  16. xScale, _ := w.(*window).viewport.GetContentScale()
  17. return xScale
  18. }
  19. return scaleAuto
  20. }