From f0dbf86799df1a75ef5e476a440790f2bae505da Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 25 Sep 2022 22:34:14 +0900 Subject: [PATCH] internal/ui: refactoring: adjust the width earlier --- internal/ui/ui_glfw.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index dd9822461..359df60a8 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -1241,8 +1241,8 @@ func (u *userInterfaceImpl) setWindowSizeInDIP(width, height int) { } width, height = u.adjustWindowSizeBasedOnSizeLimitsInDIP(width, height) - if width < 1 { - width = 1 + if m := u.minimumWindowWidth(); width < m { + width = m } if height < 1 { height = 1 @@ -1335,10 +1335,6 @@ func (u *userInterfaceImpl) setWindowSizeInDIPImpl(width, height int, fullscreen // Get the original window position and size before changing the state of fullscreen. origX, origY := u.origWindowPos() - if mw := u.minimumWindowWidth(); width < mw { - width = mw - } - wasFullscreen := u.isFullscreen() if u.isNativeFullscreenAvailable() && u.isNativeFullscreen() { u.setNativeFullscreen(false)