(direction int)
| 396 | func (b *Board) Select(id string) { b.Selected = id } |
| 397 | |
| 398 | func (b *Board) Cycle(direction int) { |
| 399 | if len(b.Notes) == 0 { |
| 400 | return |
| 401 | } |
| 402 | idx := -1 |
| 403 | for i, n := range b.Notes { |
| 404 | if n.ID == b.Selected { |
| 405 | idx = i |
| 406 | break |
| 407 | } |
| 408 | } |
| 409 | idx += direction |
| 410 | if idx < 0 { |
| 411 | idx = len(b.Notes) - 1 |
| 412 | } |
| 413 | if idx >= len(b.Notes) { |
| 414 | idx = 0 |
| 415 | } |
| 416 | b.Selected = b.Notes[idx].ID |
| 417 | } |
| 418 | |
| 419 | func (b *Board) HitTopmost(cx, cy int) int { |
| 420 | for i := len(b.Notes) - 1; i >= 0; i-- { |