Skip to content

feat(svg): stroke-dasharray and stroke-dashoffset - #57

Merged
dskripchenko merged 1 commit into
mainfrom
feat/svg-stroke-dasharray
Nov 8, 2026
Merged

dskripchenko merged 1 commit into
mainfrom
feat/svg-stroke-dasharray

Conversation

@dskripchenko

Copy link
Copy Markdown
Owner

SVG dashed strokes (stroke-dasharray, stroke-dashoffset) are drawn with a PDF dash pattern in a graphics state of their own. 22 new tests; full suite and PHPStan pass. CHANGELOG under Unreleased.

🤖 Generated with Claude Code

Dashed strokes in SVG printed solid: the renderer never read the dash
properties. Every stroked shape (line, polyline, polygon, path, rect,
circle, ellipse) now gets its dash pattern, in plain and transformed
groups alike, scaled as its stroke width. The properties resolve like the
other presentation properties: element, style, style sheet, group.
`none`, negative or non-absolute lengths and an all-zero list stroke
solid; an odd list is repeated once; the offset becomes the PDF phase,
wrapped into one period.

The pattern is set inside a graphics state of its own
(Page::withLineDashPattern(), on a new ContentStream::pushGraphicsState()),
so it never reaches the next shape or the page outside the SVG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dskripchenko
dskripchenko merged commit c642f71 into main Nov 8, 2026
10 checks passed
@dskripchenko
dskripchenko deleted the feat/svg-stroke-dasharray branch November 8, 2026 21:35
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