DimsFor returns rendered note size at a zoom level.
(zoom int)
| 47 | |
| 48 | // DimsFor returns rendered note size at a zoom level. |
| 49 | func DimsFor(zoom int) NoteDims { |
| 50 | s := zoomScale(zoom) |
| 51 | w := int(float32(baseNoteW)*s + 0.5) |
| 52 | h := int(float32(baseNoteH)*s + 0.5) |
| 53 | if w < 6 { |
| 54 | w = 6 |
| 55 | } |
| 56 | if h < 4 { |
| 57 | h = 4 |
| 58 | } |
| 59 | return NoteDims{W: w, H: h} |
| 60 | } |
| 61 | |
| 62 | // WorldX / WorldY convert a screen cell coordinate to the equivalent |
| 63 | // world coordinate given the zoom scale. |
no test coverage detected