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)
| 945 | // Point is upper left corner of selection box that anchors the translation and scaling, |
| 946 | // and for rotation it is the center point around which to rotate |
| 947 | func (g *Path) ApplyDeltaTransform(sv *SVG, trans math32.Vector2, scale math32.Vector2, rot float32, pt math32.Vector2) { |
| 948 | crot := g.Paint.Transform.ExtractRot() |
| 949 | if rot != 0 || crot != 0 { |
| 950 | xf, lpt := g.DeltaTransform(trans, scale, rot, pt, false) // exclude self |
| 951 | g.Paint.Transform.SetMulCenter(xf, lpt) |
| 952 | g.SetProperty("transform", g.Paint.Transform.String()) |
| 953 | } else { |
| 954 | xf, lpt := g.DeltaTransform(trans, scale, rot, pt, true) // include self |
| 955 | g.ApplyTransformImpl(xf, lpt) |
| 956 | g.GradientApplyTransformPt(sv, xf, lpt) |
| 957 | } |
| 958 | } |
| 959 | |
| 960 | // ApplyTransformImpl does the implementation of applying a transform to all points |
| 961 | func (g *Path) ApplyTransformImpl(xf math32.Matrix2, lpt math32.Vector2) { |
nothing calls this directly
no test coverage detected