From 5ef8b73b29a0201882d7d5836adfa93477a3da96 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sun, 3 Apr 2011 20:11:26 -0400 Subject: [PATCH] SketchWidget: remove size param from draw*() --- SketchWidget.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/SketchWidget.py b/SketchWidget.py index 5e08037..060b165 100644 --- a/SketchWidget.py +++ b/SketchWidget.py @@ -109,7 +109,7 @@ class SketchWidget: self.drawConstraints() if self.drawingLine is not None: - self.drawLine(self.drawingLine, self.line_width) + self.drawLine(self.drawingLine) if gldrawable.is_double_buffered(): gldrawable.swap_buffers() @@ -138,12 +138,12 @@ class SketchWidget: def screenDistToDist(self, dist): return dist * self.size[0] / self.view_width - def drawLine(self, shape, size): + def drawLine(self, shape): pt0 = self.ptToScreenPt(shape.getPt(0)) pt1 = self.ptToScreenPt(shape.getPt(1)) - self.drawFilledLine(pt0[0], pt0[1], pt1[0], pt1[1], size) + self.drawFilledLine(pt0[0], pt0[1], pt1[0], pt1[1], self.line_width) - def drawCircle(self, shape, size): + def drawCircle(self, shape): center = self.ptToScreenPt(shape.getCenter()) rad = self.distToScreenDist(shape.getRadius()) if rad < 30: @@ -166,8 +166,8 @@ class SketchWidget: y0 = center[1] + rad * math.sin(angle) x1 = center[0] + rad * math.cos(next_angle) y1 = center[1] + rad * math.sin(next_angle) - self.drawFilledLineUncapped(x0, y0, x1, y1, size) - self.drawFilledCircle(x0, y0, size, 8) + self.drawFilledLineUncapped(x0, y0, x1, y1, self.line_width) + self.drawFilledCircle(x0, y0, self.line_width, 8) def drawFilledLine(self, x0, y0, x1, y1, size): self.drawFilledLineUncapped(x0, y0, x1, y1, size) @@ -266,9 +266,9 @@ class SketchWidget: glColor(*self.line_color) for shape in self.sketch: if isinstance(shape, Line): - self.drawLine(shape, self.line_width) + self.drawLine(shape) elif isinstance(shape, Circle): - self.drawCircle(shape, self.line_width) + self.drawCircle(shape) def drawConstraints(self): glColor(*self.constraint_color)