ApplyDeltaTransform applies the given 2D delta transforms to the geometry of this node relative to given point. Trans translation and point are in top-level coordinates, so must be transformed into local coords first. Point is upper left corner of selection box that anchors the translation and scal
(sv *SVG, trans math32.Vector2, scale math32.Vector2, rot float32, pt math32.Vector2)
| 149 | // Point is upper left corner of selection box that anchors the translation and scaling, |
| 150 | // and for rotation it is the center point around which to rotate |
| 151 | func (g *Image) ApplyDeltaTransform(sv *SVG, trans math32.Vector2, scale math32.Vector2, rot float32, pt math32.Vector2) { |
| 152 | crot := g.Paint.Transform.ExtractRot() |
| 153 | if rot != 0 || crot != 0 { |
| 154 | xf, lpt := g.DeltaTransform(trans, scale, rot, pt, false) // exclude self |
| 155 | g.Paint.Transform.SetMulCenter(xf, lpt) |
| 156 | g.SetProperty("transform", g.Paint.Transform.String()) |
| 157 | } else { |
| 158 | xf, lpt := g.DeltaTransform(trans, scale, rot, pt, true) // include self |
| 159 | g.Pos = xf.MulVector2AsPointCenter(g.Pos, lpt) |
| 160 | g.Size = xf.MulVector2AsVector(g.Size) |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | // WriteGeom writes the geometry of the node to a slice of floating point numbers |
| 165 | // the length and ordering of which is specific to each node type. |
nothing calls this directly
no test coverage detected