Fix zero-length stroke and dash handling - #597
Open
waywardmonkeys wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
I didn't mean to request a Copilot review. :( |
Preserve intentional zero-length geometry through `dash()` so `stroke()` can apply its cap style instead of dropping it as a degenerate segment. Emit cap-only geometry for open and closed zero-length subpaths, including degenerate line, quadratic, and cubic commands. `Butt` caps remain empty, while `Round`, `Square`, and mixed caps produce the corresponding full or half shape. Keep dash starts in the half-open range `[0, path_length)`, avoiding spurious output at exact segment and open-path boundaries. Preserve explicit zero-length dashes as `MoveTo(p)`/`LineTo(p)` pairs, and treat zero-sum or non-finite dash inputs as undashed without relying on `NaN` normalization.
waywardmonkeys
force-pushed
the
fix/degenerate-stroke-caps
branch
from
July 23, 2026 17:09
bf91f7d to
1bdbca1
Compare
Contributor
Author
|
Ends up Copilot was right about another edge case. Fixed it in a different way. |
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.
Preserve intentional zero-length geometry through
dash()sostroke()can apply its cap style instead of dropping it as a degenerate segment.Emit cap-only geometry for open and closed zero-length subpaths, including degenerate line, quadratic, and cubic commands.
Buttcaps remain empty, whileRound,Square, and mixed caps produce the corresponding full or half shape.Keep dash starts in the half-open range
[0, path_length), avoiding spurious output at exact segment and open-path boundaries. Preserve explicit zero-length dashes asMoveTo(p)/LineTo(p)pairs, and treat zero-sum or non-finite dash inputs as undashed without relying onNaNnormalization.