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

Feature Request: Order elements to Group Paths #941

Open
colin-kerkhof opened this issue Apr 5, 2018 · 3 comments
Open

Feature Request: Order elements to Group Paths #941

colin-kerkhof opened this issue Apr 5, 2018 · 3 comments

Comments

@colin-kerkhof
Copy link

The elements could be reorderd to save path elements

Sample SVG

<svg>
    <path d="M0,0 h25 v25 h-25 z"/>
    <use href="#a"/>
    <path d="M100,100 h25 v25 h-25 z"/>
<svg/>

Output

<svg>
    <use href="#a"/>
    <path d="M0,0 h25 v25 h-25 z M100,100 h25 v25 h-25 z"/>
<svg/>
@GreLI
Copy link
Member

GreLI commented Apr 5, 2018

Yes, it's possible and the idea is quite trivial. However, figures may overlap and you must be sure that that is not the case. And that is where an implementation become not trivial, because 1) there is no fast algorithm for detecting intersection that I'm aware of, 2) you must consider strokes, transformations and all that stuff which complicates things a lot. Please, let me know if you aware of solutions for these problems.

@colin-kerkhof
Copy link
Author

  1. I'm not aware of any solution for this, but I might just dive into it to see to what extent it is possible.

  2. Don't these problems already exist with current path merger operations? And a possible workaround would be to only apply this when no styling exists at all.

@GreLI
Copy link
Member

GreLI commented Apr 5, 2018

  1. Current merger works only with siblings, so it checks paths only for compatibility.

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

2 participants