Skip to content

Commit 713690c

Browse files
authored
fix: support values of 0 in stroke-dasharray (#2721)
1 parent 67c265a commit 713690c

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.changeset/pretty-humans-add.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-pdf/pdfkit": patch
3+
---
4+
5+
fix: support values of `0` in stroke-dasharray

packages/pdfkit/src/mixins/vector.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ export default {
6767
length = [length, options.space || length];
6868
}
6969

70-
const valid = length.every((x) => Number.isFinite(x) && x > 0);
70+
const valid = length.every((x) => Number.isFinite(x) && x >= 0);
7171
if (!valid) {
7272
throw new Error(
7373
`dash(${JSON.stringify(originalLength)}, ${JSON.stringify(
7474
options
75-
)}) invalid, lengths must be numeric and greater than zero`
75+
)}) invalid, lengths must be numeric and greater than or equal to zero`
7676
);
7777
}
7878

0 commit comments

Comments
 (0)