ui: Rename sizeChanged -> toChangeSize

This commit is contained in:
Hajime Hoshi 2018-02-25 00:42:37 +09:00
parent 04341a014c
commit 0cc456b534

View File

@ -43,7 +43,7 @@ type userInterface struct {
fullscreenScale float64 fullscreenScale float64
running bool running bool
sizeChanged bool toChangeSize bool
origPosX int origPosX int
origPosY int origPosY int
runnableInBackground bool runnableInBackground bool
@ -59,7 +59,7 @@ type userInterface struct {
var ( var (
currentUI = &userInterface{ currentUI = &userInterface{
sizeChanged: true, toChangeSize: true,
origPosX: -1, origPosX: -1,
origPosY: -1, origPosY: -1,
initCursorVisible: true, initCursorVisible: true,
@ -439,10 +439,10 @@ func (u *userInterface) updateGraphicsContext(g GraphicsContext) {
sizeChanged := false sizeChanged := false
// TODO: Is it possible to reduce 'runOnMainThread' calls? // TODO: Is it possible to reduce 'runOnMainThread' calls?
_ = u.runOnMainThread(func() error { _ = u.runOnMainThread(func() error {
if !u.sizeChanged { if !u.toChangeSize {
return nil return nil
} }
u.sizeChanged = false u.toChangeSize = false
actualScale = u.actualScreenScale() actualScale = u.actualScreenScale()
sizeChanged = true sizeChanged = true
return nil return nil
@ -594,7 +594,6 @@ func (u *userInterface) setScreenSize(width, height int, scale float64, fullscre
// buffering, what will happen? // buffering, what will happen?
glfw.SwapInterval(1) glfw.SwapInterval(1)
// TODO: Rename this variable? u.toChangeSize = true
u.sizeChanged = true
return true return true
} }