Skip to content

Nested svgs #2

Description

@rcoreilly

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions