summaryrefslogtreecommitdiff
path: root/lib/commands.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/commands.py')
-rw-r--r--lib/commands.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/commands.py b/lib/commands.py
index a7affb6d..6280fc0c 100644
--- a/lib/commands.py
+++ b/lib/commands.py
@@ -347,7 +347,13 @@ def get_command_pos(element, index, total):
# Put command symbols 30 pixels out from the shape, spaced evenly around it.
# get a line running 30 pixels out from the shape
- outline = element.shape.buffer(30).exterior
+
+ if not isinstance(element.shape.buffer(30), shgeo.MultiPolygon):
+ outline = element.shape.buffer(30).exterior
+ else:
+ polygons = element.shape.buffer(30).geoms
+ polygon = polygons[len(polygons)-1]
+ outline = polygon.exterior
# find the top center point on the outline and start there
top_center = shgeo.Point(outline.centroid.x, outline.bounds[1])