StyleCSS applies css style properties to given SVG node parsing out type, .class, and #name selectors
(sv *SVG, css map[string]any)
| 377 | // StyleCSS applies css style properties to given SVG node |
| 378 | // parsing out type, .class, and #name selectors |
| 379 | func (g *NodeBase) StyleCSS(sv *SVG, css map[string]any) { |
| 380 | tyn := strings.ToLower(g.NodeType().Name) // type is most general, first |
| 381 | g.ApplyCSS(sv, tyn, css) |
| 382 | cln := "." + strings.ToLower(g.Class) // then class |
| 383 | g.ApplyCSS(sv, cln, css) |
| 384 | idnm := "#" + strings.ToLower(g.Name) // then name |
| 385 | g.ApplyCSS(sv, idnm, css) |
| 386 | } |
| 387 | |
| 388 | // LocalBBoxToWin converts a local bounding box to SVG coordinates |
| 389 | func (g *NodeBase) LocalBBoxToWin(bb math32.Box2) image.Rectangle { |