pec extra-write bug

pull/113/head
tatarize 2021-03-02 15:43:01 -08:00 zatwierdzone przez GitHub
rodzic d52b213b3d
commit 61e4b763b7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -590,6 +590,11 @@ class EmbPattern:
Any prepended thread change command to the merging pattern is suppressed.
:param pattern: pattern to add to current pattern
:param dx: position change of the added pattern x
:param dy: position change of the added pattern y
:param sx: scale of the added pattern x
:param sy: scale fo the added pattern y
:param rotate: rotation of the added pattern
:return:
"""
if isinstance(pattern, str):

Wyświetl plik

@ -133,8 +133,9 @@ def pec_encode(pattern, f):
xx += dx
yy += dy
if data == STITCH:
if jumping and dx != 0 and dy != 0:
f.write(b'\x00\x00')
if jumping:
if dx != 0 and dy != 0:
f.write(b'\x00\x00')
jumping = False
if -64 < dx < 63 and -64 < dy < 63:
f.write(bytes(bytearray([dx & MASK_07_BIT, dy & MASK_07_BIT])))