diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2023-01-15 20:04:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-15 20:04:10 +0100 |
| commit | 1cdb3538a83a13d97907d08908750f0d85de6978 (patch) | |
| tree | ddccf347d43ff850f4e8eca0e4c541dbd3cf2e4f /lib/elements/stroke.py | |
| parent | 4156c4adb4eadaf024b29df1df6bf1c91d3777a8 (diff) | |
Add bean stitch repeat pattern (#1938)
! backward compatibility warning:
Users need to fix their documents if they used comma separated values for multiple fill underlays (without a space)
Diffstat (limited to 'lib/elements/stroke.py')
| -rw-r--r-- | lib/elements/stroke.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/elements/stroke.py b/lib/elements/stroke.py index a95edf70..73973bf7 100644 --- a/lib/elements/stroke.py +++ b/lib/elements/stroke.py @@ -112,12 +112,13 @@ class Stroke(EmbroideryElement): _('Bean stitch number of repeats'), tooltip=_('Backtrack each stitch this many times. ' 'A value of 1 would triple each stitch (forward, back, forward). ' - 'A value of 2 would quintuple each stitch, etc.'), - type='int', + 'A value of 2 would quintuple each stitch, etc.\n\n' + 'A pattern with various repeats can be created with a list of values separated by a space.'), + type='str', default=0, sort_index=3) def bean_stitch_repeats(self): - return self.get_int_param("bean_stitch_repeats", 0) + return self.get_multiple_int_param("bean_stitch_repeats", "0") @property @param('running_stitch_length_mm', @@ -463,7 +464,7 @@ class Stroke(EmbroideryElement): if self.stroke_method == 1: patch = self.ripple_stitch() if patch: - if self.bean_stitch_repeats > 0: + if any(self.bean_stitch_repeats): patch.stitches = self.do_bean_repeats(patch.stitches) patches.append(patch) else: @@ -475,7 +476,8 @@ class Stroke(EmbroideryElement): # running stitch elif self.is_running_stitch(): patch = self.running_stitch(path, self.running_stitch_length, self.running_stitch_tolerance) - if self.bean_stitch_repeats > 0: + # bean stitch + if any(self.bean_stitch_repeats): patch.stitches = self.do_bean_repeats(patch.stitches) # simple satin else: |
