Merged
Conversation
nical
requested changes
Apr 17, 2025
Owner
nical
left a comment
There was a problem hiding this comment.
Thanks!
According to the SVG spec:
the miter is clipped by a line perpendicular to the line bisecting the angle between the two path segments at a distance of half the value of miter length from the intersection of the two path segments.
So unless I missed something, lyon currently clips at half of the correct distance (oops), and your change makes it clip at twice the correct distance.
The fix should be:
get_clip_intersections(n0, n1, normal, miter_limit * join.half_width);
Contributor
Author
|
@nical Woops, looks like I was looking at the SVG 1 spec. Fixed it now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If I'm understanding it correctly
MiterClipshould clip at a distance of the miter limit multiplied by the stroke width, but at the moment it actually clips to a quarter of this because the half width is being halved again instead of doubled in the clip distance calculation.Possibly related to #923 but I could not reproduce the bug exactly as described (falling back to bevel as opposed to just getting the clip length wrong).
Before fix:

After fix:
