internal/ui: refactoring: remove sizeChanged for js

It is safe to call Layout every frame.
This commit is contained in:
Hajime Hoshi 2022-02-14 02:50:32 +09:00
parent e2f0878a4c
commit cffa123405

View File

@ -57,8 +57,6 @@ type UserInterface struct {
cursorShape CursorShape
onceUpdateCalled bool
sizeChanged bool
lastDeviceScaleFactor float64
context *contextImpl
@ -67,7 +65,6 @@ type UserInterface struct {
var theUI = &UserInterface{
runnableOnUnfocused: true,
sizeChanged: true,
initFocused: true,
}
@ -229,8 +226,6 @@ func (u *UserInterface) updateSize() {
}
u.lastDeviceScaleFactor = a
if u.sizeChanged {
u.sizeChanged = false
switch {
case document.Truthy():
body := document.Get("body")
@ -246,7 +241,6 @@ func (u *UserInterface) updateSize() {
u.context.layout(640, 480)
}
}
}
func (u *UserInterface) suspended() bool {
if u.runnableOnUnfocused {
@ -611,7 +605,6 @@ func (u *UserInterface) updateScreenSize() {
case go2cpp.Truthy():
// TODO: Implement this
}
u.sizeChanged = true
}
func (u *UserInterface) SetScreenTransparent(transparent bool) {