ui: Refactoring

This commit is contained in:
Hajime Hoshi 2017-06-30 11:07:19 +09:00
parent cefa86ce13
commit 68fbf59720

View File

@ -289,15 +289,17 @@ func (u *userInterface) update(g GraphicsContext) error {
} }
actualScale := 0.0 actualScale := 0.0
sizeChanged := false
_ = u.runOnMainThread(func() error { _ = u.runOnMainThread(func() error {
if !u.sizeChanged { if !u.sizeChanged {
return nil return nil
} }
u.sizeChanged = false u.sizeChanged = false
actualScale = u.actualScreenScale() actualScale = u.actualScreenScale()
sizeChanged = true
return nil return nil
}) })
if 0 < actualScale { if sizeChanged {
g.SetSize(u.width, u.height, actualScale) g.SetSize(u.width, u.height, actualScale)
} }