fix irregular bean stitch start (#2257)

pull/2259/head
Kaalleen 2023-04-30 11:27:21 +02:00 zatwierdzone przez GitHub
rodzic d67a020c20
commit 3dc922b993
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 7 usunięć

Wyświetl plik

@ -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