Skip to content

Commit

Permalink
fix: stroke dash array computation (#2948)
Browse files Browse the repository at this point in the history
* fix: stroke dash array computation

* Create beige-tools-appear.md
  • Loading branch information
diegomura authored Nov 16, 2024
1 parent ed562b9 commit 03322a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/beige-tools-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-pdf/render": patch
---

fix: stroke dash array computation
2 changes: 1 addition & 1 deletion packages/render/src/primitives/renderSvg.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const setLineCap = (ctx, node) => {
const setLineDash = (ctx, node) => {
const value = node.props?.strokeDasharray || null;

if (value) ctx.dash(value.split(',').map(Number));
if (value) ctx.dash(value.split(/[\s,]+/).map(Number));
};

const hasLinearGradientFill = (node) =>
Expand Down

0 comments on commit 03322a7

Please sign in to comment.