From ca6fc84d4b28903cd4fb0f577d297edc577db29e Mon Sep 17 00:00:00 2001 From: Rick Levine Date: Tue, 7 Mar 2023 08:02:26 -0800 Subject: Allow locks, trim, stop on manual stitch placement (#2101) Co-authored-by: Lex Neva --- lib/elements/element.py | 2 +- lib/elements/stroke.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/elements/element.py b/lib/elements/element.py index ba15d943..759574d3 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 c633a2c6..8f50690c 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) -- cgit v1.2.3