diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-08-16 15:49:14 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-08-16 15:49:14 -0400 |
| commit | ee1ecb5c17ebe98d18dc62390ecb6c09f648a52e (patch) | |
| tree | b8f1e9940cdda694625ff31ceab127fef513f182 | |
| parent | 101f952422b55a06206c63c9c0d9af3147112e92 (diff) | |
| download | gui-ee1ecb5c17ebe98d18dc62390ecb6c09f648a52e.zip | |
gofmt
| -rw-r--r-- | mux.go | 11 | ||||
| -rw-r--r-- | share.go | 2 |
2 files changed, 8 insertions, 5 deletions
@@ -10,8 +10,8 @@ import ( // events and their draw functions get redirected to the root Env. type Mux struct { addEventsIn chan<- chan<- Event - size sharedVal[image.Rectangle] - draw chan<- func(draw.Image) image.Rectangle + size sharedVal[image.Rectangle] + draw chan<- func(draw.Image) image.Rectangle } // NewMux creates a new Mux that multiplexes the given Env. It returns the Mux along with @@ -24,7 +24,7 @@ func NewMux(env Env) (mux *Mux, master Env) { drawChan := make(chan func(draw.Image) image.Rectangle) mux = &Mux{ addEventsIn: addEventsIn, - size: size, + size: size, draw: drawChan, } @@ -123,4 +123,7 @@ func (mux *Mux) makeEnv(master bool) Env { return env } -func drain[T any](c <-chan T) { for range c {} } +func drain[T any](c <-chan T) { + for range c { + } +} @@ -11,7 +11,7 @@ package gui // A sharedVal should be closed after use. type sharedVal[T any] struct { request chan<- chan T - set chan<- T + set chan<- T } func newSharedVal[T any]() sharedVal[T] { |