ui: Bug fixed: there was an error shadowed and not used

This commit is contained in:
Hajime Hoshi 2016-05-14 03:25:44 +09:00
parent a04ce352f8
commit 295e3c0a0a

View File

@ -149,7 +149,7 @@ func (u *UserInterface) ActualScreenScale() int {
} }
func (u *UserInterface) Start(width, height, scale int, title string) error { func (u *UserInterface) Start(width, height, scale int, title string) error {
var ferr error var err error
u.runOnMainThread(func() { u.runOnMainThread(func() {
m := glfw.GetPrimaryMonitor() m := glfw.GetPrimaryMonitor()
v := m.GetVideoMode() v := m.GetVideoMode()
@ -166,7 +166,7 @@ func (u *UserInterface) Start(width, height, scale int, title string) error {
} }
if !u.setScreenSize(width, height, scale) { if !u.setScreenSize(width, height, scale) {
ferr = errors.New("ui: Fail to set the screen size") err = errors.New("ui: Fail to set the screen size")
return return
} }
u.window.SetTitle(title) u.window.SetTitle(title)
@ -176,7 +176,7 @@ func (u *UserInterface) Start(width, height, scale int, title string) error {
y := (v.Height - height*u.windowScale()) / 3 y := (v.Height - height*u.windowScale()) / 3
u.window.SetPos(x, y) u.window.SetPos(x, y)
}) })
return nil return err
} }
func (u *UserInterface) windowScale() int { func (u *UserInterface) windowScale() int {