mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
ui: Bug fix: Changing screen size didn't work correctly on Windows
Fixes #775
This commit is contained in:
parent
28665cfc4b
commit
5514a9c6ac
@ -639,18 +639,14 @@ 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) {
|
||||||
go func() {
|
s := glfwScale()
|
||||||
w := int(float64(width) / u.scale)
|
w := int(float64(width) / u.scale / s)
|
||||||
h := int(float64(height) / u.scale)
|
h := int(float64(height) / u.scale / s)
|
||||||
_ = mainthread.Run(func() error {
|
if u.fullscreen() {
|
||||||
if u.fullscreen() {
|
return
|
||||||
return nil
|
}
|
||||||
}
|
u.reqWidth = w
|
||||||
u.reqWidth = w
|
u.reqHeight = h
|
||||||
u.reqHeight = h
|
|
||||||
return nil
|
|
||||||
})
|
|
||||||
}()
|
|
||||||
})
|
})
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user