mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
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:
parent
ca6e681672
commit
288e0a33ba
@ -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
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user