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

When closing a path with z, the next stroke still applies a linejoin effect #1487

Closed
Tracked by #2067
MewPurPur opened this issue Jun 11, 2023 · 1 comment
Closed
Tracked by #2067
Assignees
Labels
bug Something isn't working svg SVG features
Milestone

Comments

@MewPurPur
Copy link
Collaborator

MewPurPur commented Jun 11, 2023

After I optimized a lot of Godot's SVGs, which uses this library, one of the simple SVGs broke:

image

<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="m2 2h12v12H2zl12 12" fill="none" stroke-width="2" stroke="#ffca5f"/></svg>

It can be fixed by moving by a zero vector m0 0 after z closes the path.

Expected behavior: After the path is closed, linejoin applies only between the closure stroke and the initial stroke.

Actual behavior: When the path is closed and another stroke is drawn immediately from the same location, it seems as though linejoin is drawn between the closing stroke and the new stroke, as well as between the initial stroke and the new stroke.

image

@MewPurPur MewPurPur changed the title When closing a path with Z, the next stroke still applies a linejoin effect. When closing a path with z, the next stroke still applies a linejoin effect. Jun 11, 2023
@hermet hermet added svg SVG features bug Something isn't working labels Jun 12, 2023
@hermet hermet changed the title When closing a path with z, the next stroke still applies a linejoin effect. When closing a path with z, the next stroke still applies a linejoin effect Jul 30, 2023
@hermet hermet mentioned this issue Mar 18, 2024
37 tasks
@hermet hermet self-assigned this Mar 25, 2024
@hermet hermet added this to the 0.13 milestone Mar 26, 2024
hermet added a commit that referenced this issue Mar 26, 2024
There are differences in behavior compared to the SVG spec,
especially when consecutive line drawings occur without a moveTo command
following a closePath command.

Actually, thorvg didn't care the behavior in that scenario,
this update ensures the scenario is handled correctly
to align with the SVG specification.

issue: #1487
hermet added a commit that referenced this issue Mar 27, 2024
There are differences in behavior compared to the SVG spec,
especially when consecutive line drawings occur without a moveTo command
following a closePath command.

Actually, thorvg didn't care the behavior in that scenario,
this update ensures the scenario is handled correctly
to align with the SVG specification.

issue: #1487
@hermet hermet closed this as completed Mar 27, 2024
hermet added a commit that referenced this issue Mar 29, 2024
There are differences in behavior compared to the SVG spec,
especially when consecutive line drawings occur without a moveTo command
following a closePath command.

Actually, thorvg didn't care the behavior in that scenario,
this update ensures the scenario is handled correctly
to align with the SVG specification.

issue: #1487
@hermet
Copy link
Member

hermet commented Mar 31, 2024

hot fix due to a regression bug. #2118

hermet added a commit that referenced this issue Apr 5, 2024
There are differences in behavior compared to the SVG spec,
especially when consecutive line drawings occur without a moveTo command
following a closePath command.

Actually, thorvg didn't care the behavior in that scenario,
this update ensures the scenario is handled correctly
to align with the SVG specification.

issue: #1487
hermet added a commit that referenced this issue Apr 6, 2024
There are differences in behavior compared to the SVG spec,
especially when consecutive line drawings occur without a moveTo command
following a closePath command.

Actually, thorvg didn't care the behavior in that scenario,
this update ensures the scenario is handled correctly
to align with the SVG specification.

issue: #1487
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working svg SVG features
Projects
Status: Done 0.13
Development

No branches or pull requests

2 participants