diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2025-04-15 20:20:58 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-15 20:20:58 +0200 |
| commit | ae6464ea755cfdd5a109dd0bfc6cf6e59fb450c6 (patch) | |
| tree | 43db0a4272099106fafaadbdfa0963f9f995e711 /lib | |
| parent | d50290e43256ffce7a74c2ba556b095e96a9c92e (diff) | |
lettering: fix adding trims when last element is marker or command (#3664)
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/lettering/font.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/lettering/font.py b/lib/lettering/font.py index 64320c92..f5a2cc39 100644 --- a/lib/lettering/font.py +++ b/lib/lettering/font.py @@ -519,12 +519,14 @@ class Font(object): for value in elements.values(): self._add_trim_to_element(Stroke(value), use_trim_symbols) else: + nodes = list(group.iterdescendants(EMBROIDERABLE_TAGS))[::-1] # find the last path that does not carry a marker or belongs to a visual command and add a trim there - for path_child in group.iterdescendants(EMBROIDERABLE_TAGS): - if not has_marker(path_child) and not path_child.get_id().startswith('command_connector'): - path = path_child - element = Stroke(path) - self._add_trim_to_element(element, use_trim_symbols) + for path_child in nodes: + if has_marker(path_child) or path_child.get_id().startswith('command_connector'): + continue + element = Stroke(path_child) + self._add_trim_to_element(element, use_trim_symbols) + break def _add_trim_to_element(self, element, use_trim_symbols): if element.shape: |
