From 16f6aeaa4a16d9a4d2600914f17e0f7c40a6f9bf Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 6 Oct 2018 02:38:02 +0900 Subject: [PATCH] ui: Refactoring: Use the current monitor --- internal/ui/ui_glfw.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index 62025f601..2b08950dd 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -383,8 +383,7 @@ func ScreenPadding() (x0, y0, x1, y1 float64) { return ox, 0, ox, 0 } - m := glfw.GetPrimaryMonitor() - v := m.GetVideoMode() + v := u.window.GetMonitor().GetVideoMode() d := u.deviceScale.Get() mx := float64(v.Width) * d / glfwScale() @@ -527,8 +526,7 @@ func (u *userInterface) getScale() float64 { return u.scale } if u.fullscreenScale == 0 { - m := glfw.GetPrimaryMonitor() - v := m.GetVideoMode() + v := u.window.GetMonitor().GetVideoMode() sw := float64(v.Width) / glfwScale() / float64(u.width) sh := float64(v.Height) / glfwScale() / float64(u.height) s := sw