1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-09-11 20:47:56 +03:00

Don’t extend bounding box for invisible text nodes

Fix #2030.
This commit is contained in:
Guillaume Ayoub 2024-01-22 22:53:05 +01:00
parent 4c0bd62ac1
commit 4f109c0284

View File

@ -458,7 +458,7 @@ class SVG:
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]