mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +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.SetPos(x, y)
|
||||||
|
|
||||||
u.window.SetSizeCallback(func(_ *glfw.Window, width, height int) {
|
u.window.SetSizeCallback(func(_ *glfw.Window, width, height int) {
|
||||||
s := glfwScale()
|
if u.window.GetAttrib(glfw.Resizable) == glfw.False {
|
||||||
w := int(float64(width) / u.scale / s)
|
return
|
||||||
h := int(float64(height) / u.scale / s)
|
}
|
||||||
if u.isFullscreen() {
|
if u.isFullscreen() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s := glfwScale()
|
||||||
|
w := int(float64(width) / u.scale / s)
|
||||||
|
h := int(float64(height) / u.scale / s)
|
||||||
u.reqWidth = w
|
u.reqWidth = w
|
||||||
u.reqHeight = h
|
u.reqHeight = h
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user