Skip to content

Commit 5c9bd93

Browse files
committed
Fixed NaN values in parsed style config. Fixes #75
1 parent 7089cff commit 5c9bd93

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svg2roughjs",
3-
"version": "2.3.1",
3+
"version": "2.3.2",
44
"description": "Leverages Rough.js to convert SVGs to a hand-drawn, sketchy representation",
55
"author": "Fabian Schwarzkopf",
66
"contributors": [

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ export function parseStyleConfig(
476476
if (!isIdentityTransform(svgTransform)) {
477477
const m = svgTransform!.matrix
478478
const det = m.a * m.d - m.c * m.b
479-
scaleFactor = Math.sqrt(det)
479+
scaleFactor = Math.sqrt(Math.abs(det))
480480
}
481481

482482
// incorporate the elements base opacity

0 commit comments

Comments
 (0)