MCPcopy
hub / github.com/tdewolff/canvas / CP1

Method CP1

path_scanner.go:50–56  ·  view source on GitHub ↗

CP1 returns the first control point for quadratic and cubic Béziers.

()

Source from the content-addressed store, hash-verified

48
49// CP1 returns the first control point for quadratic and cubic Béziers.
50func (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.
59func (s *PathScanner) CP2() Point {

Callers 1

PathMethod · 0.95

Calls 1

cmdLenFunction · 0.85

Tested by

no test coverage detected