From b8d5ec0e2916c71bdd6260b9944cecb1be219afc Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Sun, 27 Apr 2025 21:20:18 +0200 Subject: auto_satin: do not try to add a trim to a deleted element (#3683) --- lib/stitches/auto_satin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') 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 -- cgit v1.2.3