From 4f109c0284348f810a862eca9ada1b427316ddce Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Mon, 22 Jan 2024 22:53:05 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20extend=20bounding=20box=20for?= =?UTF-8?q?=20invisible=20text=20nodes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #2030. --- weasyprint/svg/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weasyprint/svg/__init__.py b/weasyprint/svg/__init__.py index a41cddd3f..bf592863c 100644 --- a/weasyprint/svg/__init__.py +++ b/weasyprint/svg/__init__.py @@ -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]