filled out drawConnect(), tweak colors

This commit is contained in:
Josh Holtrop 2011-04-04 14:04:26 -04:00
parent 7dc35f67bb
commit c05ea0a4b0

View File

@ -19,14 +19,14 @@ class SketchWidget:
self.drawingCircle = None
# Configuration parameters
self.line_width = 0.8
self.axis_width = 1.8
self.line_width = 1.5
self.axis_width = 2.0
self.axis_length = 50
self.zoom_factor = 1.2
self.background_color = (0.6, 0.9, 1.0, 1.0)
self.line_color = (0.1, 0.4, 1.0, 1.0)
self.axis_color = (1.0, 0.0, 0.0, 1.0)
self.constraint_color = (0.5, 1.0, 0.0, 1.0)
self.constraint_color = (0.8, 1.0, 0.0, 1.0)
try:
# try double-buffered
@ -273,7 +273,15 @@ class SketchWidget:
for c in self.sketch.constraints:
if isinstance(c, Connect):
self.drawConnect(c)
pass
def drawConnect(self, con):
glColor(*self.constraint_color)
pt = self.ptToScreenPt(con.shape1.getPt(con.pt1))
self.drawFilledCircle(pt[0], pt[1], self.line_width, 4)
s = self.line_width * 2
glBegin(GL_LINE_LOOP)
glVertex(pt[0] + s, pt[1] + s)
glVertex(pt[0] - s, pt[1] + s)
glVertex(pt[0] - s, pt[1] - s)
glVertex(pt[0] + s, pt[1] - s)
glEnd()