From d1ea9339d5a349bbde137cea8916acab1be842b9 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Tue, 9 Jun 2020 22:49:18 +0200 Subject: [PATCH] layout: change NewContext to take the FrameEvent directly The layout package imports io/system anyway, so depending on FrameEvent does not introduce new dependencies. API change. Use gofmt to adjust your code: gofmt -r 'layout.NewContext(a, b, c, d) -> layout.NewContext(a, e)' Signed-off-by: Elias Naur --- layout/context.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/layout/context.go b/layout/context.go index 009bd1f5..2eda47a5 100644 --- a/layout/context.go +++ b/layout/context.go @@ -3,7 +3,6 @@ package layout import ( - "image" "math" "time" @@ -32,19 +31,19 @@ type Context struct { // // Context{ // Ops: ops, -// Queue: q, -// Config: cfg, -// Constraints: Exact(size), +// Queue: e.Queue, +// Config: e.Config, +// Constraints: Exact(e.Size), // } // // NewContext calls ops.Reset. -func NewContext(ops *op.Ops, q event.Queue, cfg system.Config, size image.Point) Context { +func NewContext(ops *op.Ops, e system.FrameEvent) Context { ops.Reset() return Context{ Ops: ops, - Queue: q, - Config: cfg, - Constraints: Exact(size), + Queue: e.Queue, + Config: e.Config, + Constraints: Exact(e.Size), } }