1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-08-17 16:40:45 +03:00

Handle overflow for svg and symbol tags in SVG images

Fix #1864.
This commit is contained in:
Guillaume Ayoub 2023-04-18 20:10:22 +02:00
parent e881acca2e
commit 0ff8692741

View File

@ -14,7 +14,7 @@ def svg(svg, node, font_size):
node.get('width'), node.get('height'), font_size)
scale_x, scale_y, translate_x, translate_y = preserve_ratio(
svg, node, font_size, width, height)
if svg.tree != node:
if svg.tree != node and node.get('overflow', 'hidden') == 'hidden':
svg.stream.rectangle(0, 0, width, height)
svg.stream.clip()
svg.stream.end()