mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
devicescale: Rename function
This commit is contained in:
parent
10b49bb0a3
commit
1807a3f530
@ -22,7 +22,7 @@ var (
|
||||
m sync.Mutex
|
||||
)
|
||||
|
||||
func DeviceScale() float64 {
|
||||
func Get() float64 {
|
||||
m.Lock()
|
||||
defer m.Unlock()
|
||||
return impl()
|
||||
|
@ -31,7 +31,7 @@ func (d *deviceScale) Update() {
|
||||
func (d *deviceScale) Get() float64 {
|
||||
// As devicescale.DeviceScale accesses OS API, not call this too often.
|
||||
if d.val == 0 || d.frame-d.lastUpdated > 30 {
|
||||
d.val = devicescale.DeviceScale()
|
||||
d.val = devicescale.Get()
|
||||
d.lastUpdated = d.frame
|
||||
}
|
||||
return d.val
|
||||
|
@ -84,7 +84,7 @@ func deviceScale() float64 {
|
||||
defer deviceScaleM.Unlock()
|
||||
|
||||
if deviceScaleVal == 0 {
|
||||
deviceScaleVal = devicescale.DeviceScale()
|
||||
deviceScaleVal = devicescale.Get()
|
||||
}
|
||||
return deviceScaleVal
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ import (
|
||||
)
|
||||
|
||||
func glfwScale() float64 {
|
||||
return devicescale.DeviceScale()
|
||||
return devicescale.Get()
|
||||
}
|
||||
|
||||
func adjustWindowPosition(x, y int) (int, int) {
|
||||
|
Loading…
Reference in New Issue
Block a user