summaryrefslogtreecommitdiff
path: root/lib/elements/fill.py
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2018-08-09 14:52:42 -0400
committerLex Neva <github.com@lexneva.name>2018-08-09 15:17:33 -0400
commitb40c3739497439b2eee9e4d78116a8d6ee27b178 (patch)
tree372afbcd105e66ffa754d4f61153d3b93a1fb413 /lib/elements/fill.py
parent40cb74109222faba4eeb6cbfba2e906ddf9cdbf5 (diff)
bugfix: don't crash on tiny objects
Diffstat (limited to 'lib/elements/fill.py')
-rw-r--r--lib/elements/fill.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/elements/fill.py b/lib/elements/fill.py
index 8018b2b4..394f523e 100644
--- a/lib/elements/fill.py
+++ b/lib/elements/fill.py
@@ -105,9 +105,12 @@ class Fill(EmbroideryElement):
last_pt = pt
else:
last_pt = pt
- if point_ary:
+ if len(point_ary) > 2:
poly_ary.append(point_ary)
+ if not poly_ary:
+ self.fatal(_("shape %s is so small that it cannot be filled with stitches. Please make it bigger or delete it.") % self.node.get('id'))
+
# shapely's idea of "holes" are to subtract everything in the second set
# from the first. So let's at least make sure the "first" thing is the
# biggest path.