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

Function PathDataNextRel

svg/path.go:239–246  ·  view source on GitHub ↗

PathDataNextRel gets the next 2 path data points as a relative vector and returns that relative vector added to current point

(data []PathData, i *int, cp math32.Vector2)

Source from the content-addressed store, hash-verified

237// PathDataNextRel gets the next 2 path data points as a relative vector
238// and returns that relative vector added to current point
239func PathDataNextRel(data []PathData, i *int, cp math32.Vector2) math32.Vector2 {
240 v := math32.Vector2{}
241 v.X = float32(data[*i])
242 (*i)++
243 v.Y = float32(data[*i])
244 (*i)++
245 return v.Add(cp)
246}
247
248// PathDataNextCmd gets the next path data command, incrementing the index -- ++
249// not an expression so its clunky

Callers 2

PathDataRenderFunction · 0.85
PathDataIterFuncFunction · 0.85

Calls 1

AddMethod · 0.95

Tested by

no test coverage detected