summaryrefslogtreecommitdiff
path: root/lib/commands.py
diff options
context:
space:
mode:
authorClaudine Peyrat <88194877+claudinepeyrat06@users.noreply.github.com>2022-11-22 10:46:44 +0100
committerGitHub <noreply@github.com>2022-11-22 10:46:44 +0100
commit43a31ba80ee844699a52341ff7d6ef6b881e6276 (patch)
tree7735063c054e1cdc2a6d6da386a516f675177dec /lib/commands.py
parente761d8b42c178d3e9a940963234d4cd62c777f59 (diff)
Claudine/lettering with trims (#1866)
* add trim after each letter allow to add a trim after each letter * add trim after letter, word or line rewriting everythng * style correction correcting all that is signaled by make style * corrections i don't understand why i add to modify get_command_pos in commands. If I don't i can not add a command at the end of a glyph that ends with a polyline (eg B from Fold) * replace checkbox with dropdown * rename variables in English * use same trim methods for auto_satin and non auto_satin * check if trim option is never strip lines of text Co-authored-by: Claudine <claudine@MacBook-Pro-2.local> Co-authored-by: Kaalleen <reni@allenka.de> Co-authored-by: Kaalleen <36401965+kaalleen@users.noreply.github.com>
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])