zoomScale returns the render-time scale factor applied to BOTH the note dimensions AND the note positions. This is "workspace zoom": at zoom -3 the whole board is shrunk so more notes fit; at zoom +1 notes are bigger and spread further apart.
(z int)
| 25 | // the whole board is shrunk so more notes fit; at zoom +1 notes are |
| 26 | // bigger and spread further apart. |
| 27 | func zoomScale(z int) float32 { |
| 28 | switch z { |
| 29 | case -3: |
| 30 | return 0.40 |
| 31 | case -2: |
| 32 | return 0.55 |
| 33 | case -1: |
| 34 | return 0.75 |
| 35 | case 0: |
| 36 | return 1.00 |
| 37 | case +1: |
| 38 | return 1.35 |
| 39 | } |
| 40 | if z < ZoomMin { |
| 41 | return zoomScale(ZoomMin) |
| 42 | } |
| 43 | return zoomScale(ZoomMax) |
| 44 | } |
| 45 | |
| 46 | type NoteDims struct{ W, H int } |
| 47 |
no outgoing calls
no test coverage detected