From dc75e69d1e9e304e139f3662da07afaded510110 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 3 Jan 2018 19:23:29 +0900 Subject: [PATCH] ui: Rename DeviceScale -> DeviceScaleFactor --- examples/windowsize/main.go | 2 +- run.go | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/windowsize/main.go b/examples/windowsize/main.go index f312e6fb1..3ca5ac8a7 100644 --- a/examples/windowsize/main.go +++ b/examples/windowsize/main.go @@ -167,7 +167,7 @@ FPS: %0.2f`, x, y, ebiten.CurrentFPS()) } func main() { - fmt.Printf("Device scale: %0.2f\n", ebiten.DeviceScale()) + fmt.Printf("Device scale factor: %0.2f\n", ebiten.DeviceScaleFactor()) var err error gophersImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "gophers.jpg"), ebiten.FilterNearest) diff --git a/run.go b/run.go index 16f2d934d..7eeb70f38 100644 --- a/run.go +++ b/run.go @@ -108,7 +108,7 @@ func (u *updater) Invalidate() { // by the device scale on high-DPI display. // If you pass inverse of the device scale, // you can disable this automatical device scaling as a result. -// You can get the device scale by DeviceScale function. +// You can get the device scale by DeviceScaleFactor function. // // Run must be called from the OS main thread. // Note that Ebiten bounds the main goroutine to the main OS thread by runtime.LockOSThread. @@ -184,7 +184,7 @@ func SetScreenSize(width, height int) { // by the device scale on high-DPI display. // If you pass inverse of the device scale, // you can disable this automatical device scaling as a result. -// You can get the device scale by DeviceScale function. +// You can get the device scale by DeviceScaleFactor function. // // This function is concurrent-safe. func SetScreenScale(scale float64) { @@ -296,12 +296,12 @@ func SetWindowIcon(iconImages []image.Image) { ui.SetWindowIcon(iconImages) } -// DeviceScale returns a device scale value. +// DeviceScaleFactor returns a device scale value. // -// DeviceScale returns a meaningful value on high-DPI display environment, -// otherwise DeviceScale returns 1. +// DeviceScaleFactor returns a meaningful value on high-DPI display environment, +// otherwise DeviceScaleFactor returns 1. // // This function is concurrent-safe. -func DeviceScale() float64 { +func DeviceScaleFactor() float64 { return devicescale.DeviceScale() }