mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/ui: allow maximizeWindow when no max boundaries are set (#2291)
Closes #2290
This commit is contained in:
parent
5781943833
commit
9c177c1b8e
@ -289,9 +289,9 @@ func (u *userInterfaceImpl) setWindowSizeLimitsInDIP(minw, minh, maxw, maxh int)
|
||||
return true
|
||||
}
|
||||
|
||||
func (u *userInterfaceImpl) areWindowSizeLimitsSpecified() bool {
|
||||
minw, minh, maxw, maxh := u.getWindowSizeLimitsInDIP()
|
||||
return minw != glfw.DontCare || minh != glfw.DontCare || maxw != glfw.DontCare || maxh != glfw.DontCare
|
||||
func (u *userInterfaceImpl) isWindowMaximizable() bool {
|
||||
_, _, maxw, maxh := u.getWindowSizeLimitsInDIP()
|
||||
return maxw == glfw.DontCare && maxh == glfw.DontCare
|
||||
}
|
||||
|
||||
func (u *userInterfaceImpl) isInitFullscreen() bool {
|
||||
|
@ -119,7 +119,7 @@ func (w *glfwWindow) Maximize() {
|
||||
return
|
||||
}
|
||||
|
||||
if w.ui.areWindowSizeLimitsSpecified() {
|
||||
if !w.ui.isWindowMaximizable() {
|
||||
return
|
||||
}
|
||||
|
||||
@ -150,7 +150,7 @@ func (w *glfwWindow) Minimize() {
|
||||
}
|
||||
|
||||
func (w *glfwWindow) Restore() {
|
||||
if w.ui.areWindowSizeLimitsSpecified() {
|
||||
if !w.ui.isWindowMaximizable() {
|
||||
return
|
||||
}
|
||||
if !w.ui.isRunning() {
|
||||
|
Loading…
Reference in New Issue
Block a user