ui: Bug fix: SetSizeCallback must be effective only when the window is resizable

This is not a perfect solution but at least this fixes the
regression.

Fix #819
This commit is contained in:
Hajime Hoshi 2019-02-24 03:25:36 +09:00
parent ca6e681672
commit 288e0a33ba

View File

@ -643,12 +643,16 @@ 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) {
s := glfwScale()
w := int(float64(width) / u.scale / s)
h := int(float64(height) / u.scale / s)
if u.window.GetAttrib(glfw.Resizable) == glfw.False {
return
}
if u.isFullscreen() {
return
}
s := glfwScale()
w := int(float64(width) / u.scale / s)
h := int(float64(height) / u.scale / s)
u.reqWidth = w
u.reqHeight = h
})