Skip to content

Commit

Permalink
Don’t include stroke width in g bounding boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed May 30, 2021
1 parent 75e6d79 commit 451258a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion weasyprint/svg/bounding_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 451258a

Please sign in to comment.