mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
ui: Bug fixed: there was an error shadowed and not used
This commit is contained in:
parent
a04ce352f8
commit
295e3c0a0a
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user