SketchWidget: remove size param from draw*()

This commit is contained in:
Josh Holtrop 2011-04-03 20:11:26 -04:00
parent f2fdf19079
commit 5ef8b73b29

View File

@ -109,7 +109,7 @@ class SketchWidget:
self.drawConstraints() self.drawConstraints()
if self.drawingLine is not None: if self.drawingLine is not None:
self.drawLine(self.drawingLine, self.line_width) self.drawLine(self.drawingLine)
if gldrawable.is_double_buffered(): if gldrawable.is_double_buffered():
gldrawable.swap_buffers() gldrawable.swap_buffers()
@ -138,12 +138,12 @@ class SketchWidget:
def screenDistToDist(self, dist): def screenDistToDist(self, dist):
return dist * self.size[0] / self.view_width return dist * self.size[0] / self.view_width
def drawLine(self, shape, size): def drawLine(self, shape):
pt0 = self.ptToScreenPt(shape.getPt(0)) pt0 = self.ptToScreenPt(shape.getPt(0))
pt1 = self.ptToScreenPt(shape.getPt(1)) 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()) center = self.ptToScreenPt(shape.getCenter())
rad = self.distToScreenDist(shape.getRadius()) rad = self.distToScreenDist(shape.getRadius())
if rad < 30: if rad < 30:
@ -166,8 +166,8 @@ class SketchWidget:
y0 = center[1] + rad * math.sin(angle) y0 = center[1] + rad * math.sin(angle)
x1 = center[0] + rad * math.cos(next_angle) x1 = center[0] + rad * math.cos(next_angle)
y1 = center[1] + rad * math.sin(next_angle) y1 = center[1] + rad * math.sin(next_angle)
self.drawFilledLineUncapped(x0, y0, x1, y1, size) self.drawFilledLineUncapped(x0, y0, x1, y1, self.line_width)
self.drawFilledCircle(x0, y0, size, 8) self.drawFilledCircle(x0, y0, self.line_width, 8)
def drawFilledLine(self, x0, y0, x1, y1, size): def drawFilledLine(self, x0, y0, x1, y1, size):
self.drawFilledLineUncapped(x0, y0, x1, y1, size) self.drawFilledLineUncapped(x0, y0, x1, y1, size)
@ -266,9 +266,9 @@ class SketchWidget:
glColor(*self.line_color) glColor(*self.line_color)
for shape in self.sketch: for shape in self.sketch:
if isinstance(shape, Line): if isinstance(shape, Line):
self.drawLine(shape, self.line_width) self.drawLine(shape)
elif isinstance(shape, Circle): elif isinstance(shape, Circle):
self.drawCircle(shape, self.line_width) self.drawCircle(shape)
def drawConstraints(self): def drawConstraints(self):
glColor(*self.constraint_color) glColor(*self.constraint_color)