diff options
| author | George Steel <george.steel@gmail.com> | 2022-11-23 21:59:37 -0500 |
|---|---|---|
| committer | George Steel <george.steel@gmail.com> | 2022-11-23 21:59:37 -0500 |
| commit | 74f0943cc8e73a68b84d69acc1482bf1657e3ad6 (patch) | |
| tree | bca22600fc3d0730a75171945ee9fd4d9f755ce9 /lib/commands.py | |
| parent | 7cef2c9a094abe61282ac9bdc6bbfdc1e3e1d8c6 (diff) | |
| parent | df4c5cd59b0e391048c8fd2271893dbd49ec7cd3 (diff) | |
Merge branch 'main' of https://github.com/inkstitch/inkstitch into george-steel/pull-comp-percent
Diffstat (limited to 'lib/commands.py')
| -rw-r--r-- | lib/commands.py | 8 |
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]) |
