ui: Bug fix: Changing screen size didn't work correctly on Windows

Fixes #775
This commit is contained in:
Hajime Hoshi 2019-01-09 11:06:06 +09:00
parent 28665cfc4b
commit 5514a9c6ac

View File

@ -639,18 +639,14 @@ func Run(width, height int, scale float64, title string, g GraphicsContext, main
u.window.SetPos(x, y)
u.window.SetSizeCallback(func(_ *glfw.Window, width, height int) {
go func() {
w := int(float64(width) / u.scale)
h := int(float64(height) / u.scale)
_ = mainthread.Run(func() error {
if u.fullscreen() {
return nil
}
u.reqWidth = w
u.reqHeight = h
return nil
})
}()
s := glfwScale()
w := int(float64(width) / u.scale / s)
h := int(float64(height) / u.scale / s)
if u.fullscreen() {
return
}
u.reqWidth = w
u.reqHeight = h
})
return nil
})