Skip to content

Fix drop all-zero stroke-dasharray patterns - #383

Closed
amandeavor wants to merge 1 commit into
yWorks:masterfrom
amandeavor:fix/drop-zero-stroke-dasharray
Closed

amandeavor wants to merge 1 commit into
yWorks:masterfrom
amandeavor:fix/drop-zero-stroke-dasharray

Conversation

@amandeavor

Copy link
Copy Markdown
Contributor

Summary

stroke-dasharray="0.00 0.00" (and other all-zero patterns) is valid-ish in SVG as a solid stroke, but invalid in PDF — Acrobat errors on it. Maintainer note on #343: a small guard here is OK.

Change

  • Parse the dash array as before
  • If every value is 0, leave strokeDasharray unset (solid stroke) instead of calling setLineDashPattern([0, 0], …)
  • Unit tests for isEffectivelySolidDashArray

Fixes #343

Validation

  • npm run format
  • npm run typecheck
  • npm run lint
  • npx vitest run test/parsing/parsing.spec.ts — 6 passed

PDF rejects dash patterns of all zeroes (Acrobat errors). In SVG,
stroke-dasharray="0 0" is equivalent to a solid stroke, so treat it as
absent instead of calling setLineDashPattern([0, 0], …).

Fixes yWorks#343
Copilot AI lite review requested due to automatic review settings September 25, 2026 07:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@amandeavor

Copy link
Copy Markdown
Contributor Author

Closing as duplicate of #382, which already has the fix plus a strokes visual regression for #343.

@amandeavor amandeavor closed this Sep 25, 2026
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.

stroke-dasharray="0.00 0.00" should probably be dropped

2 participants