Skip to content

Commit

Permalink
Round PNG size
Browse files Browse the repository at this point in the history
It’s not perfect, but it’s better than truncating.

Fix #414.
  • Loading branch information
liZe committed Mar 11, 2024
1 parent 051df1b commit 71a59d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cairosvg/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,8 @@ class PNGSurface(Surface):

def _create_surface(self, width, height):
"""Create and return ``(cairo_surface, width, height)``."""
width = int(width)
height = int(height)
width = int(round(width))
height = int(round(height))
cairo_surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height)
return cairo_surface, width, height

Expand Down

0 comments on commit 71a59d2

Please sign in to comment.