ui: Bug fix: position was wrong when changing window size

This commit is contained in:
Hajime Hoshi 2017-06-30 01:53:14 +09:00
parent 5b6fa2d384
commit 2996f778b6

View File

@ -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)