Skip to content

Commit bf91f7d

Browse files
Fix zero-length stroke and dash handling
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.
1 parent ca27349 commit bf91f7d

2 files changed

Lines changed: 691 additions & 41 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ This release has an [MSRV][] of 1.85.
1818
## Added
1919
- `serde` and `schemars` support for `Axis`. ([#591][] by [@waywardmonkeys][])
2020

21+
## Fixed
22+
23+
- `stroke` now emits cap geometry for zero-length subpaths when round or square caps are selected. ([#597][] by [@waywardmonkeys][])
24+
- `dash` no longer emits spurious zero-length segments at exact dash boundaries and preserves intentional zero-length dashes. ([#597][] by [@waywardmonkeys][])
25+
2126
## [0.13.1][] (2026-05-13)
2227

2328
This release has an [MSRV][] of 1.85.
@@ -317,6 +322,7 @@ Note: A changelog was not kept for or before this release
317322
[#580]: https://github.com/linebender/kurbo/pull/580
318323
[#585]: https://github.com/linebender/kurbo/pull/585
319324
[#591]: https://github.com/linebender/kurbo/pull/591
325+
[#597]: https://github.com/linebender/kurbo/pull/597
320326

321327
[Unreleased]: https://github.com/linebender/kurbo/compare/v0.13.1...HEAD
322328
[0.13.1]: https://github.com/linebender/kurbo/releases/tag/v0.13.1

0 commit comments

Comments
 (0)