mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/ui: refactoring
This commit is contained in:
parent
98076bd512
commit
9302230fef
@ -1241,14 +1241,6 @@ func (u *userInterfaceImpl) setWindowSizeInDIP(width, height int, fullscreen boo
|
||||
}
|
||||
|
||||
width, height = u.adjustWindowSizeBasedOnSizeLimitsInDIP(width, height)
|
||||
|
||||
u.graphicsDriver.SetFullscreen(fullscreen)
|
||||
|
||||
scale := u.deviceScaleFactor(u.currentMonitor())
|
||||
if u.origWindowWidthInDIP == width && u.origWindowHeightInDIP == height && u.isFullscreen() == fullscreen && u.lastDeviceScaleFactor == scale {
|
||||
return
|
||||
}
|
||||
|
||||
if width < 1 {
|
||||
width = 1
|
||||
}
|
||||
@ -1256,6 +1248,12 @@ func (u *userInterfaceImpl) setWindowSizeInDIP(width, height int, fullscreen boo
|
||||
height = 1
|
||||
}
|
||||
|
||||
u.graphicsDriver.SetFullscreen(fullscreen)
|
||||
|
||||
scale := u.deviceScaleFactor(u.currentMonitor())
|
||||
if u.origWindowWidthInDIP == width && u.origWindowHeightInDIP == height && u.isFullscreen() == fullscreen && u.lastDeviceScaleFactor == scale {
|
||||
return
|
||||
}
|
||||
u.lastDeviceScaleFactor = scale
|
||||
|
||||
u.origWindowWidthInDIP = width
|
||||
|
Loading…
Reference in New Issue
Block a user