mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
internal/ui: bug fix: make the window resizable after the window is created
Making the window resizable BEFORE the window is created doesn't work correctly, especially when switching to enable resizing later. Closes #1987
This commit is contained in:
parent
5899470511
commit
0291986658
@ -885,11 +885,9 @@ func (u *UserInterface) init() error {
|
||||
glfw.WindowHint(glfw.TransparentFramebuffer, transparent)
|
||||
Graphics().SetTransparent(u.isInitScreenTransparent())
|
||||
|
||||
resizable := glfw.False
|
||||
if u.isInitWindowResizable() {
|
||||
resizable = glfw.True
|
||||
}
|
||||
glfw.WindowHint(glfw.Resizable, resizable)
|
||||
// Before creating a window, set it unresizable no matter what u.isInitWindowResizable() is (#1987).
|
||||
// Making the window resizable here doesn't work correctly when switching to enable resizing.
|
||||
glfw.WindowHint(glfw.Resizable, glfw.False)
|
||||
|
||||
floating := glfw.False
|
||||
if u.isInitWindowFloating() {
|
||||
@ -924,6 +922,8 @@ func (u *UserInterface) init() error {
|
||||
u.setWindowPositionInDIP(wx, wy, u.initMonitor)
|
||||
u.setWindowSizeInDIP(ww, wh, u.isFullscreen())
|
||||
|
||||
u.setWindowResizable(u.isInitWindowResizable())
|
||||
|
||||
// Maximizing a window requires a proper size and position. Call Maximize here (#1117).
|
||||
if u.isInitWindowMaximized() {
|
||||
u.window.Maximize()
|
||||
|
Loading…
Reference in New Issue
Block a user