FingerHoles: use .saved_context()

This commit is contained in:
Florian Festi 2019-02-24 14:42:48 +01:00
parent 1801cfd0cc
commit abed8c06ac
1 changed files with 16 additions and 20 deletions

View File

@ -674,7 +674,7 @@ class FingerHoles(FingerJointBase):
:param bedBoltSettings: (Default value = None) :param bedBoltSettings: (Default value = None)
""" """
self.boxes.ctx.save() with self.boxes.saved_context():
self.boxes.moveTo(x, y, angle) self.boxes.moveTo(x, y, angle)
s, f = self.settings.space, self.settings.finger s, f = self.settings.space, self.settings.finger
p = self.settings.play p = self.settings.play
@ -694,10 +694,6 @@ class FingerHoles(FingerJointBase):
self.boxes.rectangularHole(pos + 0.5 * f, 0, self.boxes.rectangularHole(pos + 0.5 * f, 0,
f+p, self.settings.width+p) f+p, self.settings.width+p)
self.ctx.restore()
self.ctx.move_to(0, 0)
class FingerHoleEdge(BaseEdge): class FingerHoleEdge(BaseEdge):
"""Edge with holes for a parallel finger joint""" """Edge with holes for a parallel finger joint"""
char = 'h' char = 'h'