From 5fd32a2e226bded97e2ad33628ac5d40e50bf733 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Sat, 29 Jun 2013 13:55:57 +0200 Subject: [PATCH] Make burn an __init__ param and fix burn correction for callbacks --- boxes.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/boxes.py b/boxes.py index 317de4a..dade467 100755 --- a/boxes.py +++ b/boxes.py @@ -63,9 +63,9 @@ class Bolts(BoltPolicy): class Boxes: - def __init__(self, width=300, height=200, thickness=3.0): + def __init__(self, width=300, height=200, thickness=3.0, burn=0.1): self.thickness = thickness - self.burn = 0.1 # radius + self.burn = burn self.fingerJointSettings = (10.0, 10.0) self.fingerHoleEdgeWidth = 1.0 # multitudes of self.thickness self.bedBoltSettings = (3, 5.5, 2, 20, 15) #d, d_nut, h_nut, l, l1 @@ -92,8 +92,10 @@ class Boxes: ctx.set_line_width(2*self.burn) - def cc(self, callback, number, x=0.0, y=0.0): + def cc(self, callback, number, x=0.0, y=None): """call callback""" + if y is None: + y = self.burn self.ctx.save() self.moveTo(x, y) if callable(callback):