Commit Graph
3 Commits
Author SHA1 Message Date
mtlcl410andClaude Opus 5.5 ba16b9b5b8 M2: a segment after h begins a new subpath (hayro patch 61)
ISO 32000-2 §8.5.2.1, Table 58: h "terminates the current subpath.
Appending another segment to the current path shall begin a new subpath,
even if the new segment begins at the endpoint reached by the h
operation." kurbo carries a segment after ClosePath on from the subpath
start without a MoveTo, so resolve_degenerate_subpaths saw "h" then an "l"
back to that point as part of the closed subpath, and the round-cap dot
of that degenerate subpath was lost (main drew it, through the nudge this
PR removed). l, c, v and y after h now start with a MoveTo to the point h
reached.

Review on #4410 (CodeRabbit, vendor/hayro-interpret/src/interpret/mod.rs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-11-02 08:00:22 +08:00
mtlcl410andClaude Opus 5.5 07cab37e7b M2: test that a trailing open single-point subpath leaves the line before it alone
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-10-30 15:07:21 +08:00
mtlcl410andClaude Opus 5.5 e5051ca139 M2: degenerate subpaths, all-zero dash arrays and negative line widths stroke as ISO 32000-2 8.5.3.2 / 8.4.3 say
Vendored hayro-interpret patch 61.

- A degenerate subpath (a single-point closed path, or points that all
  coincide) is stroked as a dot of the line width with round caps and not
  at all with butt or projecting square caps (8.5.3.2). The zero-length
  `l` is no longer nudged a ten-thousandth of a point (which gave square
  caps a direction to draw a square in), and `x y m h` keeps its `h`
  (kurbo's `is_empty` counts only segments, so it was dropped and the
  subpath painted nothing). Other subpaths and zero-length dashes are
  untouched.
- A dash array that is all zero, or has a negative or non-finite entry,
  is kept as `[]`, a solid line (8.4.3.6). `[0 0]` used to become
  `[0.01 0.01]`, a faint half-covered line.
- A negative or non-finite line width from `w` or `/LW` is kept as 0,
  the thinnest line (8.4.3.2), so no device sees a width below zero. The
  renderer already drew it as a one-pixel line in the stroke colour.

Tests: crates/render/tests/it/stroke_geometry.rs (pixel checks and a
recording device).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0175FWj4xFhMhSH3UpMU8DSC
2026-10-30 15:07:21 +08:00