Skip to content

feat(api): dashed strokes for vector paths - PathBuilder.dashed#171

Merged
DemchaAV merged 1 commit into
developfrom
feat/path-dash-pattern
Jun 12, 2026
Merged

feat(api): dashed strokes for vector paths - PathBuilder.dashed#171
DemchaAV merged 1 commit into
developfrom
feat/path-dash-pattern

Conversation

@DemchaAV

Copy link
Copy Markdown
Owner

What

addPath(...) strokes can now be dashed — dashed(on, off, …) with the same DocumentDashPattern contract as lines; the pattern follows the curve.

  • PathNode / PathFragmentPayload gain a dashPattern component (last position, nullNONE — mirroring LineNode one-to-one). Unreleased API, free change.
  • applyDashPattern deduplicated out of PdfLineFragmentRenderHandler into the shared PdfShapeGeometry, applied inside the saved fill/stroke graphics state — lines and paths emit identical dash arrays, fills unaffected.
  • PathBuilder.dashed(double...) + dashed(DocumentDashPattern).
  • Example gains a dashed Bézier wave (dashed(6, 3)), page resized so the gallery preview stays single-page; demo sheet, README section and CHANGELOG updated.

Verification

  • New tests: node dash default (NONE), builder pass-through (containsExactly(4.0, 2.0)); all path/chart suites green.
  • Regenerated vector-path.pdf preview eyeballed: dashes follow the curve cleanly.
  • Senior-review pass done pre-PR (the change is the line-dash golden pattern applied 1:1 + a dedup); full gate: see below.

…hared DocumentDashPattern

PathNode/PathFragmentPayload gain a dashPattern component (last position, null normalizes to NONE - the LineNode pattern one-to-one), PathBuilder gains dashed(double...) and dashed(DocumentDashPattern), and the dash array is applied inside the shared fill/stroke graphics state. applyDashPattern is deduplicated from PdfLineFragmentRenderHandler into PdfShapeGeometry so lines and paths emit identical dash arrays. Example gains a dashed Bezier wave block (page resized to keep the gallery preview single-page); demo sheet, README section, and CHANGELOG updated. Tests: dash default NONE, builder pass-through, ctor call sites updated. Full gate below.
@DemchaAV DemchaAV merged commit 41dae5c into develop Jun 12, 2026
11 checks passed
@DemchaAV DemchaAV deleted the feat/path-dash-pattern branch June 12, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant