feat(api): dashed strokes for vector paths - PathBuilder.dashed#171
Merged
Conversation
…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.
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.
What
addPath(...)strokes can now be dashed —dashed(on, off, …)with the sameDocumentDashPatterncontract as lines; the pattern follows the curve.PathNode/PathFragmentPayloadgain adashPatterncomponent (last position,null→NONE— mirroringLineNodeone-to-one). Unreleased API, free change.applyDashPatterndeduplicated out ofPdfLineFragmentRenderHandlerinto the sharedPdfShapeGeometry, applied inside the saved fill/stroke graphics state — lines and paths emit identical dash arrays, fills unaffected.PathBuilder.dashed(double...)+dashed(DocumentDashPattern).dashed(6, 3)), page resized so the gallery preview stays single-page; demo sheet, README section and CHANGELOG updated.Verification
NONE), builder pass-through (containsExactly(4.0, 2.0)); all path/chart suites green.vector-path.pdfpreview eyeballed: dashes follow the curve cleanly.