ui: Bug fix: actualScreenScale must be called on the main thread

This commit is contained in:
Hajime Hoshi 2019-01-16 23:32:47 +09:00
parent f16f6cf4b9
commit 645b94de5f

View File

@ -411,7 +411,11 @@ func ScreenPadding() (x0, y0, x1, y1 float64) {
return 0, 0, 0, 0 return 0, 0, 0, 0
} }
// The window width can be bigger than the game screen width (#444). // The window width can be bigger than the game screen width (#444).
ox := (float64(u.windowWidth)*u.actualScreenScale() - float64(u.width)*u.actualScreenScale()) / 2 ox := 0.0
_ = mainthread.Run(func() error {
ox = (float64(u.windowWidth)*u.actualScreenScale() - float64(u.width)*u.actualScreenScale()) / 2
return nil
})
return ox, 0, ox, 0 return ox, 0, ox, 0
} }