Use zero if cannot parse stroke width

This commit is contained in:
Paul Kaplan
2017-10-12 15:59:45 -04:00
parent b84721d5b3
commit be1306387d

View File

@@ -197,7 +197,10 @@ class SvgRenderer {
largestStrokeWidth = Math.max(largestStrokeWidth, 1);
}
if (domElement.getAttribute('stroke-width')) {
largestStrokeWidth = Math.max(largestStrokeWidth, Number(domElement.getAttribute('stroke-width')));
largestStrokeWidth = Math.max(
largestStrokeWidth,
Number(domElement.getAttribute('stroke-width')) || 0
);
}
}
for (let i = 0; i < domElement.childNodes.length; i++) {