mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55: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
|
package layout
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"image"
|
|
||||||
"math"
|
"math"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -32,19 +31,19 @@ type Context struct {
|
|||||||
//
|
//
|
||||||
// Context{
|
// Context{
|
||||||
// Ops: ops,
|
// Ops: ops,
|
||||||
// Queue: q,
|
// Queue: e.Queue,
|
||||||
// Config: cfg,
|
// Config: e.Config,
|
||||||
// Constraints: Exact(size),
|
// Constraints: Exact(e.Size),
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// NewContext calls ops.Reset.
|
// 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()
|
ops.Reset()
|
||||||
return Context{
|
return Context{
|
||||||
Ops: ops,
|
Ops: ops,
|
||||||
Queue: q,
|
Queue: e.Queue,
|
||||||
Config: cfg,
|
Config: e.Config,
|
||||||
Constraints: Exact(size),
|
Constraints: Exact(e.Size),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user