From 7617a225f6c37f4a3ec75cfda253172bfe4bd6fd Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 27 Feb 2016 02:17:31 +0900 Subject: [PATCH] ui: deviceScaleFactor -> deviceScale --- internal/ui/ui_glfw.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index e856de53f..b08b51bfb 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -101,27 +101,27 @@ func ActualScale() int { } type userInterface struct { - window *glfw.Window - width int - height int - scale int - deviceScaleFactor float64 - framebufferScale int - context *opengl.Context + window *glfw.Window + width int + height int + scale int + deviceScale float64 + framebufferScale int + context *opengl.Context } func (u *userInterface) start(width, height, scale int, title string) error { m := glfw.GetPrimaryMonitor() v := m.GetVideoMode() mw, _ := m.GetPhysicalSize() - u.deviceScaleFactor = 1 + u.deviceScale = 1 u.framebufferScale = 1 // mw can be 0 on some environment like Linux VM if 0 < mw { dpi := float64(v.Width) * 25.4 / float64(mw) - u.deviceScaleFactor = dpi / 96 - if u.deviceScaleFactor < 1 { - u.deviceScaleFactor = 1 + u.deviceScale = dpi / 96 + if u.deviceScale < 1 { + u.deviceScale = 1 } } @@ -137,7 +137,7 @@ func (u *userInterface) start(width, height, scale int, title string) error { } func (u *userInterface) windowScale() int { - return u.scale * int(u.deviceScaleFactor) + return u.scale * int(u.deviceScale) } func (u *userInterface) actualScale() int {