Skip to content

Commit 3c5707c

Browse files
committed
use 1px if the stroke width isn't defined
1 parent e376167 commit 3c5707c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/getSvgFromGraphicsObject.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,11 @@ export function getSvgFromGraphicsObject(
235235
points: projectedPoints.map((p) => `${p.x},${p.y}`).join(" "),
236236
fill: "none",
237237
stroke: line.strokeColor || "black",
238-
"stroke-width":
239-
typeof line.strokeWidth === "string"
238+
"stroke-width": !line.strokeWidth
239+
? "1px"
240+
: typeof line.strokeWidth === "string"
240241
? line.strokeWidth
241-
: (strokeScale * (line.strokeWidth ?? 1)).toString(),
242+
: (strokeScale * line.strokeWidth).toString(),
242243
...(line.strokeDash && {
243244
"stroke-dasharray": Array.isArray(line.strokeDash)
244245
? line.strokeDash.join(" ")

0 commit comments

Comments
 (0)