all: rename more *layout.Context names to gtx

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-09-25 09:43:15 +02:00
parent a89c6d1c33
commit 9c33550644
4 changed files with 43 additions and 43 deletions
+4 -4
View File
@@ -77,7 +77,7 @@ func initProfiling() {
func (a *App) run() error {
a.ui.profiling = *stats
c := &layout.Context{
gtx := &layout.Context{
Queue: a.w.Queue(),
}
for {
@@ -127,9 +127,9 @@ func (a *App) run() error {
}
}
case app.UpdateEvent:
c.Reset(&e.Config, layout.RigidConstraints(e.Size))
a.ui.Layout(c)
a.w.Update(c.Ops)
gtx.Reset(&e.Config, layout.RigidConstraints(e.Size))
a.ui.Layout(gtx)
a.w.Update(gtx.Ops)
}
}
}
+3 -3
View File
@@ -19,12 +19,12 @@ func BenchmarkUI(b *testing.B) {
fetch := func(_ string) {}
u := newUI(fetch)
cfg := new(config)
c := &layout.Context{
gtx := &layout.Context{
Queue: new(queue),
}
for i := 0; i < b.N; i++ {
c.Reset(cfg, layout.RigidConstraints(image.Point{800, 600}))
u.Layout(c)
gtx.Reset(cfg, layout.RigidConstraints(image.Point{800, 600}))
u.Layout(gtx)
}
}