mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +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
7f569f3071
commit
6443af6401
@ -900,11 +900,9 @@ func (u *UserInterface) init() error {
|
||||
glfw.WindowHint(glfw.TransparentFramebuffer, transparent)
|
||||
u.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() {
|
||||
@ -948,6 +946,8 @@ func (u *UserInterface) init() error {
|
||||
|
||||
u.updateWindowSizeLimits()
|
||||
|
||||
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