From 3dc922b993cba29b8026654581b9f042835a8cdc Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Sun, 30 Apr 2023 11:27:21 +0200 Subject: fix irregular bean stitch start (#2257) --- lib/stitches/running_stitch.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/stitches/running_stitch.py b/lib/stitches/running_stitch.py index 46f3a3e9..18eeb3c9 100644 --- a/lib/stitches/running_stitch.py +++ b/lib/stitches/running_stitch.py @@ -278,18 +278,13 @@ def bean_stitch(stitches, repeats): return stitches repeat_list_length = len(repeats) - repeat_list_pos = 0 - new_stitches = [stitches[0]] - for stitch in stitches: + for i, stitch in enumerate(stitches[1:]): + repeat_list_pos = i % repeat_list_length new_stitches.append(stitch) for i in range(repeats[repeat_list_pos]): new_stitches.extend(copy(new_stitches[-2:])) - repeat_list_pos += 1 - if repeat_list_pos == repeat_list_length: - repeat_list_pos = 0 - return new_stitches -- cgit v1.2.3