deal with invalid geometry of some kind

This commit is contained in:
Laura Klünder 2024-12-25 16:32:51 +01:00
parent 705a4a5de9
commit e5c6fde55e
2 changed files with 3 additions and 3 deletions

View file

@ -183,7 +183,7 @@ class Command(BaseCommand):
for polygon in self.parse_svg_data(path.attrib['d']):
if len(polygon) < 3:
continue
polygon = Polygon(polygon)
polygon = Polygon(polygon).buffer(0)
polygon = translate(polygon, xoff=-offset_x, yoff=-offset_y)
polygon = scale(polygon, xfact=1, yfact=-1, origin=(0, svg_height/2))
polygon = scale(polygon, xfact=width / svg_width, yfact=height / svg_height, origin=(0, 0))