summaryrefslogtreecommitdiff
path: root/lib/stitches
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2025-04-27 21:20:18 +0200
committerGitHub <noreply@github.com>2025-04-27 21:20:18 +0200
commitb8d5ec0e2916c71bdd6260b9944cecb1be219afc (patch)
tree19b8a6cb7c2a27b0607f0a33dbeaef6cfc45d214 /lib/stitches
parent3a359bc126fc91888466ef1b17261d934ad95d9c (diff)
auto_satin: do not try to add a trim to a deleted element (#3683)
Diffstat (limited to 'lib/stitches')
-rw-r--r--lib/stitches/auto_satin.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/stitches/auto_satin.py b/lib/stitches/auto_satin.py
index 67f5de34..fc869485 100644
--- a/lib/stitches/auto_satin.py
+++ b/lib/stitches/auto_satin.py
@@ -633,9 +633,12 @@ def add_trims(elements, trim_indices):
trim_indices = set(trim_indices)
new_elements = []
just_trimmed = False
+ just_removed = False
+
for i, element in enumerate(elements):
if just_trimmed and isinstance(element, Stroke):
element.node.delete()
+ just_removed = True
continue
if i in trim_indices:
@@ -645,9 +648,10 @@ def add_trims(elements, trim_indices):
just_trimmed = False
new_elements.append(element)
+ just_removed = False
# trim at the end, too
- if i not in trim_indices:
+ if i not in trim_indices and not just_removed:
add_commands(element, ["trim"])
return new_elements