ui: Refactoring: Use the current monitor

This commit is contained in:
Hajime Hoshi 2018-10-06 02:38:02 +09:00
parent c0884b5ab2
commit 16f6aeaa4a

View File

@ -383,8 +383,7 @@ func ScreenPadding() (x0, y0, x1, y1 float64) {
return ox, 0, ox, 0 return ox, 0, ox, 0
} }
m := glfw.GetPrimaryMonitor() v := u.window.GetMonitor().GetVideoMode()
v := m.GetVideoMode()
d := u.deviceScale.Get() d := u.deviceScale.Get()
mx := float64(v.Width) * d / glfwScale() mx := float64(v.Width) * d / glfwScale()
@ -527,8 +526,7 @@ func (u *userInterface) getScale() float64 {
return u.scale return u.scale
} }
if u.fullscreenScale == 0 { if u.fullscreenScale == 0 {
m := glfw.GetPrimaryMonitor() v := u.window.GetMonitor().GetVideoMode()
v := m.GetVideoMode()
sw := float64(v.Width) / glfwScale() / float64(u.width) sw := float64(v.Width) / glfwScale() / float64(u.width)
sh := float64(v.Height) / glfwScale() / float64(u.height) sh := float64(v.Height) / glfwScale() / float64(u.height)
s := sw s := sw