Skip to content

Commit 6782995

Browse files
committed
Enlarge bounds by largest stroke even if zero
1 parent f472eb5 commit 6782995

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/svg-renderer.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -381,14 +381,8 @@ class SvgRenderer {
381381
// Enlarge the bbox from the largest found stroke width
382382
// This may have false-positives, but at least the bbox will always
383383
// contain the full graphic including strokes.
384-
// If the width or height is zero however, don't enlarge since
385-
// they won't have a stroke width that needs to be enlarged.
386-
let halfStrokeWidth;
387-
if (bbox.width === 0 || bbox.height === 0) {
388-
halfStrokeWidth = 0;
389-
} else {
390-
halfStrokeWidth = this._findLargestStrokeWidth(this._svgTag) / 2;
391-
}
384+
const halfStrokeWidth = this._findLargestStrokeWidth(this._svgTag) / 2;
385+
392386
const width = bbox.width + (halfStrokeWidth * 2);
393387
const height = bbox.height + (halfStrokeWidth * 2);
394388
const x = bbox.x - halfStrokeWidth;

0 commit comments

Comments
 (0)