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

Function PathDataTransformRel

svg/path.go:934–940  ·  view source on GitHub ↗

PathDataTransformRel does the transform of next two data points as relative coords compared to given cp coordinate. returns new *absolute* coordinate

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

Source from the content-addressed store, hash-verified

932// PathDataTransformRel does the transform of next two data points as relative coords
933// compared to given cp coordinate. returns new *absolute* coordinate
934func PathDataTransformRel(data []PathData, i *int, xf math32.Matrix2, cp math32.Vector2) math32.Vector2 {
935 rp := PathDataNextVector(data, i)
936 tc := xf.MulVector2AsVector(rp)
937 data[*i-2] = PathData(tc.X)
938 data[*i-1] = PathData(tc.Y)
939 return cp.Add(tc) // new abs
940}
941
942// ApplyDeltaTransform applies the given 2D delta transforms to the geometry of this node
943// relative to given point. Trans translation and point are in top-level coordinates,

Callers 1

ApplyTransformImplMethod · 0.85

Calls 4

PathDataNextVectorFunction · 0.85
PathDataTypeAlias · 0.85
AddMethod · 0.65
MulVector2AsVectorMethod · 0.45

Tested by

no test coverage detected