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

Method Path

path_scanner.go:165–180  ·  view source on GitHub ↗

Path returns the current path segment.

()

Source from the content-addressed store, hash-verified

163
164// Path returns the current path segment.
165func (s *PathReverseScanner) Path() *Path {
166 p := &Path{}
167 p.MoveTo(s.Start().X, s.Start().Y)
168 switch s.Cmd() {
169 case LineToCmd:
170 p.LineTo(s.End().X, s.End().Y)
171 case QuadToCmd:
172 p.QuadTo(s.CP1().X, s.CP1().Y, s.End().X, s.End().Y)
173 case CubeToCmd:
174 p.CubeTo(s.CP1().X, s.CP1().Y, s.CP2().X, s.CP2().Y, s.End().X, s.End().Y)
175 case ArcToCmd:
176 rx, ry, rot, large, sweep := s.Arc()
177 p.ArcTo(rx, ry, rot, large, sweep, s.End().X, s.End().Y)
178 }
179 return p
180}

Callers

nothing calls this directly

Calls 11

MoveToMethod · 0.95
StartMethod · 0.95
CmdMethod · 0.95
LineToMethod · 0.95
EndMethod · 0.95
QuadToMethod · 0.95
CP1Method · 0.95
CubeToMethod · 0.95
CP2Method · 0.95
ArcMethod · 0.95
ArcToMethod · 0.95

Tested by

no test coverage detected