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

feat(convertShapeToPath): convert rect with rounded corners using arcs #1816

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

JoCa96
Copy link

@JoCa96 JoCa96 commented Nov 3, 2023

Convert rect shape with a defined rx and/or ry to path when the convertArcs parameter is true.

E.g.

<rect x="40" y="50" width="30" height="20" rx="2" ry="5"/>

will become

<path d="M68 50A2 5 0 0 1 70 55L70 65A2 5 0 0 1 68 70L42 70A2 5 0 0 1 40 65L40 55A2 5 0 0 1 42 50z"/>

When rx and ry are invalid or 0 the conversion will be performed without arcs as there are no rounded corners in that case.

@KTibow
Copy link
Contributor

KTibow commented Nov 4, 2023

why would you want to do this? this seems like the opposite of optimization

@JoCa96
Copy link
Author

JoCa96 commented Nov 4, 2023

why would you want to do this? this seems like the opposite of optimization

That's true for all conversions that are enabled by the convertArcs flag.

The need for this is use-case dependant.
If the flag is enabled it should do all the arc conversions imho. We want to reduce all shapes to a single path. You can also see the need for this in PR #1767.

@jguddas
Copy link

jguddas commented Nov 12, 2023

This is basically the opposite of #1748, there are definitely cases where one is closer than the other.

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

Successfully merging this pull request may close these issues.

3 participants