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

Function PathDataBBox

svg/path.go:613–620  ·  view source on GitHub ↗

PathDataBBox traverses the path data and extracts the local bounding box

(data []PathData)

Source from the content-addressed store, hash-verified

611
612// PathDataBBox traverses the path data and extracts the local bounding box
613func PathDataBBox(data []PathData) math32.Box2 {
614 bb := math32.B2Empty()
615 PathDataIterFunc(data, func(idx int, cmd PathCmds, ptIndex int, cp math32.Vector2, ctrls []math32.Vector2) bool {
616 bb.ExpandByPoint(cp)
617 return tree.Continue
618 })
619 return bb
620}
621
622// PathDataStart gets the starting coords and angle from the path
623func PathDataStart(data []PathData) (vec math32.Vector2, ang float32) {

Callers 1

LocalBBoxMethod · 0.85

Calls 3

B2EmptyFunction · 0.92
PathDataIterFuncFunction · 0.85
ExpandByPointMethod · 0.45

Tested by

no test coverage detected