Skip to content

Commit

Permalink
Merge pull request #113 from EmbroidePy/issue112
Browse files Browse the repository at this point in the history
pec extra-write bug
  • Loading branch information
tatarize authored Mar 2, 2021
2 parents d52b213 + 8e8f0e2 commit 311a204
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions pyembroidery/EmbPattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,11 @@ def add_pattern(self, pattern, dx=None, dy=None, sx=None, sy=None, rotate=None):
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 of the added pattern y
:param rotate: rotation of the added pattern
:return:
"""
if isinstance(pattern, str):
Expand Down
5 changes: 3 additions & 2 deletions pyembroidery/PecWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])))
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="pyembroidery",
version="1.4.26",
version="1.4.27",
author="Tatarize",
author_email="[email protected]",
description="Embroidery IO library",
Expand Down

0 comments on commit 311a204

Please sign in to comment.