mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/ui: optimization: reduce u.t.Call
This commit is contained in:
parent
f2860bebed
commit
172da82aa7
@ -501,15 +501,10 @@ func (u *userInterfaceImpl) SetFullscreen(fullscreen bool) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var update bool
|
|
||||||
u.t.Call(func() {
|
|
||||||
update = u.isFullscreen() != fullscreen
|
|
||||||
})
|
|
||||||
if !update {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
u.t.Call(func() {
|
u.t.Call(func() {
|
||||||
|
if u.isFullscreen() == fullscreen {
|
||||||
|
return
|
||||||
|
}
|
||||||
w, h := u.windowWidthInDIP, u.windowHeightInDIP
|
w, h := u.windowWidthInDIP, u.windowHeightInDIP
|
||||||
u.setWindowSizeInDIP(w, h, fullscreen)
|
u.setWindowSizeInDIP(w, h, fullscreen)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user