| | |
| | | import ( |
| | | "math" |
| | | "runtime" |
| | | "sync" |
| | | "syscall" |
| | | "time" |
| | | "unsafe" |
| | |
| | | posCh chan [2]int |
| | | closeCh chan struct{} |
| | | done chan struct{} |
| | | closeOnce sync.Once |
| | | |
| | | barHeights [nBars]float64 |
| | | animTime float64 |
| | |
| | | func (o *winOverlay) GetPosition() (int, int) { return o.posX, o.posY } |
| | | func (o *winOverlay) Size() (int, int) { return capW, capH } |
| | | func (o *winOverlay) OnDragged(fn func(x, y int)) { o.dragCb = fn } |
| | | func (o *winOverlay) Close() { close(o.closeCh); <-o.done } |
| | | func (o *winOverlay) Close() { |
| | | o.closeOnce.Do(func() { |
| | | close(o.closeCh) |
| | | }) |
| | | <-o.done |
| | | } |
| | | |
| | | func trySend(ch chan bool, v bool) { |
| | | select { |