MCPcopy Create free account
hub / github.com/cogentcore/core / PathDataEnd

Function PathDataEnd

svg/path.go:638–649  ·  view source on GitHub ↗

PathDataEnd gets the ending coords and angle from the path

(data []PathData)

Source from the content-addressed store, hash-verified

636
637// PathDataEnd gets the ending coords and angle from the path
638func PathDataEnd(data []PathData) (vec math32.Vector2, ang float32) {
639 gotSome := false
640 PathDataIterFunc(data, func(idx int, cmd PathCmds, ptIndex int, cp math32.Vector2, ctrls []math32.Vector2) bool {
641 if gotSome {
642 ang = math32.Atan2(cp.Y-vec.Y, cp.X-vec.X)
643 }
644 vec = cp
645 gotSome = true
646 return tree.Continue
647 })
648 return
649}
650
651// PathCmdNMap gives the number of points per each command
652var PathCmdNMap = map[PathCmds]int{

Callers 1

RenderMethod · 0.85

Calls 2

Atan2Function · 0.92
PathDataIterFuncFunction · 0.85

Tested by

no test coverage detected