From ca6fc84d4b28903cd4fb0f577d297edc577db29e Mon Sep 17 00:00:00 2001 From: Rick Levine Date: Tue, 7 Mar 2023 08:02:26 -0800 Subject: [PATCH] Allow locks, trim, stop on manual stitch placement (#2101) Co-authored-by: Lex Neva --- lib/elements/element.py | 2 +- lib/elements/stroke.py | 12 ++++++++++-- pyembroidery | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/elements/element.py b/lib/elements/element.py index ba15d9430..759574d3a 100644 --- a/lib/elements/element.py +++ b/lib/elements/element.py @@ -240,7 +240,7 @@ class EmbroideryElement(object): @property @param('ties', _('Allow lock stitches'), - tooltip=_('Tie thread at the beginning and/or end of this object. Manual stitch will not add lock stitches.'), + tooltip=_('Tie thread at the beginning and/or end of this object. Manual stitch will only add lock stitches if force lock stitched is checked.'), type='dropdown', # Ties: 0 = Both | 1 = Before | 2 = After | 3 = Neither # L10N options to allow lock stitch before and after objects diff --git a/lib/elements/stroke.py b/lib/elements/stroke.py index c633a2c63..8f50690c4 100644 --- a/lib/elements/stroke.py +++ b/lib/elements/stroke.py @@ -87,7 +87,7 @@ class Stroke(EmbroideryElement): @property @param('manual_stitch', _('Manual stitch placement'), - tooltip=_("Stitch every node in the path. All other options are ignored."), + tooltip=_("Stitch every node in the path. All options other than stop and trim are ignored. Lock stitches will be added only if force lock stitches is checked."), type='boolean', default=False, select_items=[('stroke_method', 0)], @@ -472,7 +472,15 @@ class Stroke(EmbroideryElement): path = [Point(x, y) for x, y in path] # manual stitch if self.manual_stitch_mode: - patch = StitchGroup(color=self.color, stitches=path, lock_stitches=(None, None)) + if self.force_lock_stitches: + lock_stitches = self.lock_stitches + else: + # manual stitch disables lock stitches unless they force them + lock_stitches = (None, None) + patch = StitchGroup(color=self.color, + stitches=path, + lock_stitches=lock_stitches, + force_lock_stitches=self.force_lock_stitches) # running stitch elif self.is_running_stitch(): patch = self.running_stitch(path, self.running_stitch_length, self.running_stitch_tolerance) diff --git a/pyembroidery b/pyembroidery index 322bfa5f7..9347ea882 160000 --- a/pyembroidery +++ b/pyembroidery @@ -1 +1 @@ -Subproject commit 322bfa5f7edbbcf741ff032b82a637d04b0b97a0 +Subproject commit 9347ea882a40764cfc712d1bb9f90324945767c0