From 35347edeb4da521af24c384cfa896240a379c7cf Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Fri, 7 Jun 2013 12:50:13 +0200 Subject: [PATCH] Fix @restore decorator and hole() to no longer keep the current point --- boxes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/boxes.py b/boxes.py index d1b340b..c1070f0 100755 --- a/boxes.py +++ b/boxes.py @@ -11,8 +11,10 @@ def restore(func): @wraps(func) def f(self, *args, **kw): self.ctx.save() + pt = self.ctx.get_current_point() func(self, *args, **kw) self.ctx.restore() + self.ctx.move_to(*pt) return f @@ -325,12 +327,10 @@ class Boxes: self.fingerHoles(length) self.ctx.restore() - + @restore def hole(self, x, y, r): - self.ctx.save() self.moveTo(x+r, y) self.ctx.arc(-r, 0, r, 0, 2*math.pi) - self.ctx.restore() # hexHoles