From 43a31ba80ee844699a52341ff7d6ef6b881e6276 Mon Sep 17 00:00:00 2001 From: Claudine Peyrat <88194877+claudinepeyrat06@users.noreply.github.com> Date: Tue, 22 Nov 2022 10:46:44 +0100 Subject: 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 Co-authored-by: Kaalleen Co-authored-by: Kaalleen <36401965+kaalleen@users.noreply.github.com> --- lib/commands.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/commands.py') 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]) -- cgit v1.2.3