diff --git a/src/svg-quirks-mode/svg-renderer.js b/src/svg-quirks-mode/svg-renderer.js index 23adc6a..016ce06 100644 --- a/src/svg-quirks-mode/svg-renderer.js +++ b/src/svg-quirks-mode/svg-renderer.js @@ -234,11 +234,11 @@ class SvgRenderer { // Enlarge the bbox from the largest found stroke width // This may have false-positives, but at least the bbox will always // contain the full graphic including strokes. - const largestStrokeWidth = this._findLargestStrokeWidth(this._svgTag); - bbox.width += largestStrokeWidth * 2; - bbox.height += largestStrokeWidth * 2; - bbox.x -= largestStrokeWidth; - bbox.y -= largestStrokeWidth; + const halfStrokeWidth = this._findLargestStrokeWidth(this._svgTag) / 2; + bbox.width += halfStrokeWidth * 2; + bbox.height += halfStrokeWidth * 2; + bbox.x -= halfStrokeWidth; + bbox.y -= halfStrokeWidth; // Set the correct measurements on the SVG tag, and save them. this._svgTag.setAttribute('width', bbox.width);