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

Function PathDataTransformAbs

svg/path.go:924–930  ·  view source on GitHub ↗

PathDataTransformAbs does the transform of next two data points as absolute coords

(data []PathData, i *int, xf math32.Matrix2, lpt math32.Vector2)

Source from the content-addressed store, hash-verified

922
923// PathDataTransformAbs does the transform of next two data points as absolute coords
924func PathDataTransformAbs(data []PathData, i *int, xf math32.Matrix2, lpt math32.Vector2) math32.Vector2 {
925 cp := PathDataNextVector(data, i)
926 tc := xf.MulVector2AsPointCenter(cp, lpt)
927 data[*i-2] = PathData(tc.X)
928 data[*i-1] = PathData(tc.Y)
929 return tc
930}
931
932// PathDataTransformRel does the transform of next two data points as relative coords
933// compared to given cp coordinate. returns new *absolute* coordinate

Callers 1

ApplyTransformImplMethod · 0.85

Calls 3

PathDataNextVectorFunction · 0.85
PathDataTypeAlias · 0.85

Tested by

no test coverage detected