Repository navigation
feat(svg): stroke-dasharray and stroke-dashoffset - #57
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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