CP1 returns the first control point for quadratic and cubic Béziers.
()
| 48 | |
| 49 | // CP1 returns the first control point for quadratic and cubic Béziers. |
| 50 | func (s *PathScanner) CP1() Point { |
| 51 | if s.p.d[s.i] != QuadToCmd && s.p.d[s.i] != CubeToCmd { |
| 52 | panic("must be quadratic or cubic Bézier") |
| 53 | } |
| 54 | i := s.i - cmdLen(s.p.d[s.i]) + 1 |
| 55 | return Point{s.p.d[i+1], s.p.d[i+2]} |
| 56 | } |
| 57 | |
| 58 | // CP2 returns the second control point for cubic Béziers. |
| 59 | func (s *PathScanner) CP2() Point { |