mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +01:00
ui: Refactoring
This commit is contained in:
parent
cefa86ce13
commit
68fbf59720
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user