diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2023-04-30 11:27:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-30 11:27:21 +0200 |
| commit | 3dc922b993cba29b8026654581b9f042835a8cdc (patch) | |
| tree | ac26495673e2cbc7f5dadced15613c79c74819b3 /lib/stitches | |
| parent | d67a020c209be07c7909e5b10c4105586bc40b20 (diff) | |
fix irregular bean stitch start (#2257)
Diffstat (limited to 'lib/stitches')
| -rw-r--r-- | lib/stitches/running_stitch.py | 9 |
1 files changed, 2 insertions, 7 deletions
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 |
