File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -234,11 +234,11 @@ class SvgRenderer {
234
234
// Enlarge the bbox from the largest found stroke width
235
235
// This may have false-positives, but at least the bbox will always
236
236
// contain the full graphic including strokes.
237
- const largestStrokeWidth = this . _findLargestStrokeWidth ( this . _svgTag ) ;
238
- bbox . width += largestStrokeWidth * 2 ;
239
- bbox . height += largestStrokeWidth * 2 ;
240
- bbox . x -= largestStrokeWidth ;
241
- bbox . y -= largestStrokeWidth ;
237
+ const halfStrokeWidth = this . _findLargestStrokeWidth ( this . _svgTag ) / 2 ;
238
+ bbox . width += halfStrokeWidth * 2 ;
239
+ bbox . height += halfStrokeWidth * 2 ;
240
+ bbox . x -= halfStrokeWidth ;
241
+ bbox . y -= halfStrokeWidth ;
242
242
243
243
// Set the correct measurements on the SVG tag, and save them.
244
244
this . _svgTag . setAttribute ( 'width' , bbox . width ) ;
You can’t perform that action at this time.
0 commit comments