Skip to content

Commit 49e24a0

Browse files
authored
fix stroke width (#37)
1 parent 70e4c58 commit 49e24a0

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

lib/getSvgFromGraphicsObject.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ export function getSvgFromGraphicsObject(graphics: GraphicsObject): string {
182182
height: scaledHeight.toString(),
183183
fill: rect.fill || "none",
184184
stroke: rect.stroke || "black",
185+
"stroke-width": Math.abs(1 / matrix.a).toString(),
185186
},
186187
}
187188
}),
@@ -202,6 +203,7 @@ export function getSvgFromGraphicsObject(graphics: GraphicsObject): string {
202203
r: scaledRadius.toString(),
203204
fill: circle.fill || "none",
204205
stroke: circle.stroke || "black",
206+
"stroke-width": Math.abs(1 / matrix.a).toString(),
205207
},
206208
}
207209
}),

tests/__snapshots__/cartesian-rect.snap.svg

Lines changed: 2 additions & 2 deletions
Loading

tests/__snapshots__/circles.snap.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/__snapshots__/rectangles.snap.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/__snapshots__/renderer-graphics.snap.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)