From 08308a7edfdf39e13a1e694e3474da74ada2604a Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 7 Apr 2019 18:51:32 -0400 Subject: [PATCH] uidriver/mobile: Refactoring --- internal/uidriver/mobile/ui.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/uidriver/mobile/ui.go b/internal/uidriver/mobile/ui.go index 90d686ee0..b2f5cf4cb 100644 --- a/internal/uidriver/mobile/ui.go +++ b/internal/uidriver/mobile/ui.go @@ -102,7 +102,7 @@ func getDeviceScale() float64 { } // appMain is the main routine for gomobile-build mode. -func appMain(a app.App) { +func (u *UserInterface) appMain(a app.App) { var glctx gl.Context touches := map[touch.Sequence]*driver.Touch{} for e := range a.Events() { @@ -122,7 +122,7 @@ func appMain(a app.App) { glctx = nil } case size.Event: - theUI.setFullscreenImpl(e.WidthPx, e.HeightPx) + u.setFullscreenImpl(e.WidthPx, e.HeightPx) case paint.Event: if glctx == nil || e.External { continue @@ -149,7 +149,7 @@ func appMain(a app.App) { for _, t := range touches { ts = append(ts, t) } - theUI.input.update(ts) + u.input.update(ts) } } } @@ -190,7 +190,7 @@ func (u *UserInterface) Loop(ch <-chan error) error { err := <-ch panic(err) }() - app.Main(appMain) + app.Main(u.appMain) return nil }