StartPos returns the start point of the current subpath, i.e. it returns the position of the last MoveTo command.
()
| 372 | |
| 373 | // StartPos returns the start point of the current subpath, i.e. it returns the position of the last MoveTo command. |
| 374 | func (p *Path) StartPos() Point { |
| 375 | for i := len(p.d); 0 < i; { |
| 376 | cmd := p.d[i-1] |
| 377 | if cmd == MoveToCmd { |
| 378 | return Point{p.d[i-3], p.d[i-2]} |
| 379 | } |
| 380 | i -= cmdLen(cmd) |
| 381 | } |
| 382 | return Point{} |
| 383 | } |
| 384 | |
| 385 | // Coords returns all the coordinates of the segment start/end points. It omits zero-length CloseCmds. |
| 386 | func (p *Path) Coords() []Point { |
no test coverage detected