GradientApplyTransformPt applies the given transform with ctr point to any gradients for this node, that are using specific coordinates (not bounding box which is automatic)
(sv *SVG, xf math32.Matrix2, pt math32.Vector2)
| 76 | // to any gradients for this node, that are using specific coordinates |
| 77 | // (not bounding box which is automatic) |
| 78 | func (g *NodeBase) GradientApplyTransformPt(sv *SVG, xf math32.Matrix2, pt math32.Vector2) { |
| 79 | gi := g.This.(Node) |
| 80 | gnm := NodePropURL(gi, "fill") |
| 81 | if gnm != "" { |
| 82 | gr := sv.GradientByName(gi, gnm) |
| 83 | if gr != nil { |
| 84 | gr.Grad.AsBase().Transform.SetMulCenter(xf, pt) // todo: ctr off? |
| 85 | } |
| 86 | } |
| 87 | gnm = NodePropURL(gi, "stroke") |
| 88 | if gnm != "" { |
| 89 | gr := sv.GradientByName(gi, gnm) |
| 90 | if gr != nil { |
| 91 | gr.Grad.AsBase().Transform.SetMulCenter(xf, pt) |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | // GradientWritePoints writes the gradient points to |
| 97 | // a slice of floating point numbers, appending to end of slice. |
no test coverage detected