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

Don’t draw clipPath when defined after reference

Fix #1595.
This commit is contained in:
Guillaume Ayoub 2023-08-19 10:25:28 +02:00
parent 6977e79ce9
commit c4d663d06e

View File

@ -418,8 +418,10 @@ class SVG:
width, height = self.point(
node.get('width'), node.get('height'), font_size)
self.stream.transform(a=width, d=height, e=x, f=y)
original_tag = clip_path._etree_node.tag
clip_path._etree_node.tag = 'g'
self.draw_node(clip_path, font_size, fill_stroke=False)
clip_path._etree_node.tag = original_tag
# At least set the clipping area to an empty path, so that its
# totally clipped when the clipping path is empty.
self.stream.rectangle(0, 0, 0, 0)