Pos returns an endpoint's SCREEN position (for drawing).
(b *Board)
| 188 | |
| 189 | // Pos returns an endpoint's SCREEN position (for drawing). |
| 190 | func (e *StringEnd) Pos(b *Board) (int, int, bool) { |
| 191 | if e.NoteID == "" { |
| 192 | // Wall pin — stored in world coords. |
| 193 | return ScreenX(e.X, b.Zoom), ScreenY(e.Y, b.Zoom), true |
| 194 | } |
| 195 | n := b.FindNote(e.NoteID) |
| 196 | if n == nil { |
| 197 | return 0, 0, false |
| 198 | } |
| 199 | x, y := n.PinPos(b.Zoom) |
| 200 | return x, y, true |
| 201 | } |
| 202 | |
| 203 | // --- Board ------------------------------------------------------------- |
| 204 |
no test coverage detected