Skip to content

why we need processing the svg with sibling > descendant priority #50

@RedTrait

Description

@RedTrait

Thanks to the author for contributing this library. While reading the source code, I found this comment. Why do we need to process the sibling nodes first?

let mut node_stack = tree
    .root()
    .children()
    .iter()
    // to make sure we are processing the svg with sibling > descendant priority we reverse it
    // and reverse the resulting descriptors before returning the final constructed svg
    .rev()
    .map(|node| NodeContext {
        node,
        transform: node.abs_transform(),
        is_text: false,
    })
    .collect::<VecDeque<_>>();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions