exyte / Macaw

Powerful and easy-to-use vector graphics Swift library with SVG support
MIT License
6.02k stars 560 forks source link

Fix #766 SVGParser will parse the `class` attribute as Node Tag. #787

Open ty0x2333 opened 2 years ago

ty0x2333 commented 2 years ago

I use Macaw for SVG rendering.

I have the same problem as #766

I need to dynamically modify the style by class. But there is no way to get nodes by class.

SVGParser currently only parses id as a Node Tag. This Pull Request parses class as a Node Tag as well.

This way, the node of the specified class can be found by the node.nodesBy(tag:) method without breaking the original design.