From 2996f778b640632f0753b96be8b319de8ff73f78 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 30 Jun 2017 01:53:14 +0900 Subject: [PATCH] ui: Bug fix: position was wrong when changing window size --- internal/ui/ui_glfw.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index cf419bfa6..fedbb20a9 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -373,7 +373,9 @@ func (u *userInterface) setScreenSize(width, height int, scale float64, fullscre u.origPosX, u.origPosY = window.GetPos() window.SetMonitor(m, 0, 0, v.Width, v.Height, v.RefreshRate) } else { - window.SetMonitor(nil, 0, 0, 16, 16, v.RefreshRate) + x, y := window.GetPos() + // TODO: y must be mirroed on macOS? + window.SetMonitor(nil, x, y, 16, 16, v.RefreshRate) ch := make(chan struct{}) window.SetFramebufferSizeCallback(func(_ *glfw.Window, width, height int) { window.SetFramebufferSizeCallback(nil)