memononen / nanosvg

Simple stupid SVG parser
zlib License
1.71k stars 363 forks source link

Added support for named groups #78

Open tpecholt opened 7 years ago

tpecholt commented 7 years ago

I have added support for named groups (). Each NSVGshape now remembers its group. Each NSVGgroup knows its parent group. List of all groups is accessible from NSVGimage. Only groups with filled id are used.

Also I removed storing group id under shape id when shape id is empty. It's confusing and group names are now accessible through NSVGshape::group.

Having groups is very useful for structuring the document. For example I have a svg viewer which shows all groups in the tree structure and allows them to turn on/off.