MoveTo moves the path to (x,y) without connecting the path. It starts a new independent subpath. Multiple subpaths can be useful when negating parts of a previous path by overlapping it with a path in the opposite direction. The behaviour for overlapping paths depends on the FillRule.
(x, y float64)
| 399 | |
| 400 | // MoveTo moves the path to (x,y) without connecting the path. It starts a new independent subpath. Multiple subpaths can be useful when negating parts of a previous path by overlapping it with a path in the opposite direction. The behaviour for overlapping paths depends on the FillRule. |
| 401 | func (p *Path) MoveTo(x, y float64) { |
| 402 | if 0 < len(p.d) && p.d[len(p.d)-1] == MoveToCmd { |
| 403 | p.d[len(p.d)-3] = x |
| 404 | p.d[len(p.d)-2] = y |
| 405 | return |
| 406 | } |
| 407 | p.d = append(p.d, MoveToCmd, x, y, MoveToCmd) |
| 408 | } |
| 409 | |
| 410 | // LineTo adds a linear path to (x,y). |
| 411 | func (p *Path) LineTo(x, y float64) { |