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
sizeChanged := false
_ = u.runOnMainThread(func() error {
if !u.sizeChanged {
return nil
}
u.sizeChanged = false
actualScale = u.actualScreenScale()
sizeChanged = true
return nil
})
if 0 < actualScale {
if sizeChanged {
g.SetSize(u.width, u.height, actualScale)
}