fix IndexError for single-path satin columns (fixes #366)

pull/481/head
Lex Neva 2019-06-19 14:01:43 -04:00
rodzic 9fccbb5033
commit 6a8f385d13
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -325,6 +325,9 @@ class SatinColumn(EmbroideryElement):
self.fatal(_("satin column: object %s has a fill (but should not)") % node_id)
if not self.rungs:
if len(self.rails) < 2:
self.fatal(_("satin column: object %(id)s has too few paths. A satin column should have at least two paths (the rails).") % dict(id=node_id))
if len(self.rails[0]) != len(self.rails[1]):
self.fatal(_("satin column: object %(id)s has two paths with an unequal number of points (%(length1)d and %(length2)d)") %
dict(id=node_id, length1=len(self.rails[0]), length2=len(self.rails[1])))