Skip to content

Commit

Permalink
Merge pull request #254 from yig/master
Browse files Browse the repository at this point in the history
Update surface.py
  • Loading branch information
liZe committed Nov 23, 2020
2 parents 83c0b83 + 1d61bfd commit dcfbca4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cairosvg/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,12 @@ def __init__(self, tree, output, dpi, parent_surface=None,
width, height = output_width, output_height
elif output_width:
if width:
# Keep the aspect ratio
height *= output_width / width
width = output_width
elif output_height:
if height:
# Keep the aspect ratio
width *= output_height / height
height = output_height
else:
Expand Down

0 comments on commit dcfbca4

Please sign in to comment.