Skip to content

Commit

Permalink
Don’t extend bounding box for invisible text nodes
Browse files Browse the repository at this point in the history
Fix #2030.
  • Loading branch information
liZe committed Jan 22, 2024
1 parent 4c0bd62 commit 4f109c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion weasyprint/svg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ def draw_node(self, node, font_size, fill_stroke=True):
if node.display and node.tag not in DEF_TYPES:
for child in node:
self.draw_node(child, font_size, fill_stroke)
if node.tag in ('text', 'tspan'):
if node.tag in ('text', 'tspan') and child.visible:
if not is_valid_bounding_box(child.text_bounding_box):
continue
x1, y1 = child.text_bounding_box[:2]
Expand Down

0 comments on commit 4f109c0

Please sign in to comment.