Skip to content

Commit

Permalink
Fix patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed Oct 3, 2021
1 parent f87e1cb commit ab3ff79
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion weasyprint/svg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ def preserve_ratio(svg, node, font_size, width, height, viewbox=None):
viewbox = viewbox or node.get_viewbox()
if viewbox:
viewbox_width, viewbox_height = viewbox[2:]
else:
elif svg.tree == node:
viewbox_width, viewbox_height = svg.get_intrinsic_size(font_size)
if None in (viewbox_width, viewbox_height):
return 1, 1, 0, 0
else:
return 1, 1, 0, 0

scale_x = width / viewbox_width if viewbox_width else 1
scale_y = height / viewbox_height if viewbox_height else 1
Expand Down

0 comments on commit ab3ff79

Please sign in to comment.