mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
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 <mail@eliasnaur.com>
This commit is contained in:
+7
-8
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user