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

Method DeltaTransform

svg/node.go:196–205  ·  view source on GitHub ↗

DeltaTransform computes the net transform matrix for given delta transform parameters and the transformed version of the reference point. If self is true, then include the current node self transform, otherwise don't. Groups do not but regular rendering nodes do.

(trans math32.Vector2, scale math32.Vector2, rot float32, pt math32.Vector2, self bool)

Source from the content-addressed store, hash-verified

194// include the current node self transform, otherwise don't. Groups do not
195// but regular rendering nodes do.
196func (g *NodeBase) DeltaTransform(trans math32.Vector2, scale math32.Vector2, rot float32, pt math32.Vector2, self bool) (math32.Matrix2, math32.Vector2) {
197 mxi := g.ParTransform(self)
198 mxi = mxi.Inverse()
199 lpt := mxi.MulVector2AsPoint(pt)
200 ldel := mxi.MulVector2AsVector(trans)
201 xf := math32.Scale2D(scale.X, scale.Y).Rotate(rot)
202 xf.X0 = ldel.X
203 xf.Y0 = ldel.Y
204 return xf, lpt
205}
206
207// ApplyDeltaTransform applies the given 2D delta transforms to the geometry of this node
208// relative to given point. Trans translation and point are in top-level coordinates,

Callers 9

ApplyDeltaTransformMethod · 0.80
ApplyDeltaTransformMethod · 0.80
ApplyDeltaTransformMethod · 0.80
ApplyDeltaTransformMethod · 0.80
ApplyDeltaTransformMethod · 0.80
ApplyDeltaTransformMethod · 0.80
ApplyDeltaTransformMethod · 0.80
ApplyDeltaTransformMethod · 0.80
ApplyDeltaTransformMethod · 0.80

Calls 6

ParTransformMethod · 0.95
Scale2DFunction · 0.92
InverseMethod · 0.45
MulVector2AsPointMethod · 0.45
MulVector2AsVectorMethod · 0.45
RotateMethod · 0.45

Tested by

no test coverage detected