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

negative scale breaks arc sweep #200

Closed
SebKuzminsky opened this issue May 5, 2023 · 0 comments · Fixed by #201
Closed

negative scale breaks arc sweep #200

SebKuzminsky opened this issue May 5, 2023 · 0 comments · Fixed by #201

Comments

@SebKuzminsky
Copy link
Contributor

Here's an SVG that demonstrates the problem:

<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100mm" height="100mm" viewBox="-100 -200 500 500" xmlns="http://www.w3.org/2000/svg" version="
1.1">
    <g id="Sketch" transform="scale(1,-1)">
        <path id="slot" d="
            M 0 10
            L 0 80
            A 30 30 0 1 0 0 140
            A 10 10 0 0 1 0 100
            L 100 100
            A 10 10 0 1 1 100 140
            A 30 30 0 0 0 100 80
            L 100 10
            A 10 10 0 0 0 90 0
            L 10 0
            A 10 10 0 0 0 0 10
        " stroke="#ff0000" stroke-width="0.35 px"/>
    </g>
</svg>

Note the group transform, with a negative Y scale.

The SVG renders like this:
Screenshot from 2023-05-05 00-39-28

When loaded into svgpathtools, the arcs are all inside out (wrong sweep):
Screenshot from 2023-05-05 00-41-47

This is the same bug as #111, which was fixed in #112 and then broken again in baba1d1 back in 1.4.2.

bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this issue May 21, 2023
https://build.opensuse.org/request/show/1088124
by user mia + dimstar_suse
- Update to 1.6.1
  * Fix circles parsing to non-closed paths
    #gh/mathandy/svgpathtools#198
  * path.transform: Arc sweep is reversed by negative scale
    #gh/mathandy/svgpathtools#200
  * return error if Path.point() cannot be computed
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 a pull request may close this issue.

1 participant