diff --git a/weasyprint/svg/bounding_box.py b/weasyprint/svg/bounding_box.py index 88344b0ec..bfdc20288 100644 --- a/weasyprint/svg/bounding_box.py +++ b/weasyprint/svg/bounding_box.py @@ -19,7 +19,7 @@ def bounding_box(svg, node, font_size): if node.tag not in BOUNDING_BOX_METHODS: return EMPTY_BOUNDING_BOX box = BOUNDING_BOX_METHODS[node.tag](svg, node, font_size) - if any(svg.get_paint(node.get('stroke'))): + if node.tag != 'g' and any(svg.get_paint(node.get('stroke'))): stroke_width = svg.length(node.get('stroke-width', '1px'), font_size) box = ( box[0] - stroke_width / 2, box[1] - stroke_width / 2,