GradientUpdateNodePoints updates the points for node based on current bbox
(n Node, prop string)
| 265 | |
| 266 | // GradientUpdateNodePoints updates the points for node based on current bbox |
| 267 | func (sv *SVG) GradientUpdateNodePoints(n Node, prop string) { |
| 268 | ps := n.AsTree().Property(prop) |
| 269 | if ps == nil { |
| 270 | return |
| 271 | } |
| 272 | pstr := ps.(string) |
| 273 | url := "url(#" |
| 274 | if !strings.HasPrefix(pstr, url) { |
| 275 | return |
| 276 | } |
| 277 | gr := sv.GradientByName(n, pstr) |
| 278 | if gr == nil { |
| 279 | return |
| 280 | } |
| 281 | gb := gr.Grad.AsBase() |
| 282 | gb.SetBox(n.LocalBBox()) |
| 283 | gb.SetTransform(math32.Identity2()) |
| 284 | } |
| 285 | |
| 286 | // GradientCloneNodeProp creates a new clone of the existing gradient for node |
| 287 | // if set for given property key ("fill" or "stroke"). |
nothing calls this directly
no test coverage detected