Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested svgs #2

Open
rcoreilly opened this issue Sep 19, 2023 · 0 comments
Open

Nested svgs #2

rcoreilly opened this issue Sep 19, 2023 · 0 comments

Comments

@rcoreilly
Copy link
Member

Structure will need to be modified to deal better with nested SVGs. Currently we have an SVGNode as the Root of the Ki tree, and other SVGNodes can be added as nodes, but they behave just like Groups.

  • first todo: modify Render and xform to properly position according to Viewbox.

Apparently, nested svg's render to the same underlying image -- i.e., we still want the outer-most SVG element to be the only one with an actual image.

The only tricky bit is nested <defs> -- apparently it is legal: https://stackoverflow.com/questions/44226035/are-multiple-defs-allowed-in-svg-documents

but the name id's have to be unique across everything (whole html doc, not just svg!)

all of the current url handling is done using top-level SVG. For efficiency, it could cache a list of sub-defs groups and iterate over those.

for grid drawing app, it is almost certainly more robust to import svg integrated into main svg vs. making a sub. check what inkscape does.

links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant