devicescale: Rename function

This commit is contained in:
Hajime Hoshi 2018-10-04 01:28:53 +09:00
parent 10b49bb0a3
commit 1807a3f530
5 changed files with 5 additions and 5 deletions

View File

@ -22,7 +22,7 @@ var (
m sync.Mutex
)
func DeviceScale() float64 {
func Get() float64 {
m.Lock()
defer m.Unlock()
return impl()

View File

@ -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

View File

@ -84,7 +84,7 @@ func deviceScale() float64 {
defer deviceScaleM.Unlock()
if deviceScaleVal == 0 {
deviceScaleVal = devicescale.DeviceScale()
deviceScaleVal = devicescale.Get()
}
return deviceScaleVal
}

View File

@ -23,7 +23,7 @@ import (
)
func glfwScale() float64 {
return devicescale.DeviceScale()
return devicescale.Get()
}
func adjustWindowPosition(x, y int) (int, int) {

2
run.go
View File

@ -528,7 +528,7 @@ func SetWindowIcon(iconImages []image.Image) {
//
// DeviceScaleFactor is concurrent-safe.
func DeviceScaleFactor() float64 {
return devicescale.DeviceScale()
return devicescale.Get()
}
// IsVsyncEnabled returns a boolean value indicating whether