Add turtle param to polygonWall

to allow using it as turtle graphic command instead of a part
This commit is contained in:
Florian Festi 2019-04-07 17:28:40 +02:00
parent dc11929258
commit 0b781ce7ef
1 changed files with 9 additions and 5 deletions

View File

@ -1864,7 +1864,8 @@ class Boxes:
return ext
def polygonWall(self, borders, edge="f", callback=None, move=None):
def polygonWall(self, borders, edge="f", turtle=False,
callback=None, move=None):
e = self.edges.get(edge, edge)
t = self.thickness # XXX edge.margin()
@ -1872,6 +1873,8 @@ class Boxes:
minx, miny, maxx, maxy = self._polygonWallExtend(borders, e)
tw, th = maxx - minx, maxy - miny
if not turtle:
if self.move(tw, th, move, True):
return
@ -1893,6 +1896,7 @@ class Boxes:
self.edge(length_correction)
self.corner(next_angle, tabs=1)
if not turtle:
self.move(tw, th, move)
@restore