ui: Don't call devicescale.DeviceScale too often

This commit is contained in:
Hajime Hoshi 2018-10-03 04:29:12 +09:00
parent 11d23bafa9
commit 10b49bb0a3

View File

@ -27,12 +27,9 @@ package ui
// } // }
import "C" import "C"
import (
"github.com/hajimehoshi/ebiten/internal/devicescale"
)
func glfwScale() float64 { func glfwScale() float64 {
return devicescale.DeviceScale() // This function must be called on the main thread.
return currentUI.deviceScale.Get()
} }
func adjustWindowPosition(x, y int) (int, int) { func adjustWindowPosition(x, y int) (int, int) {