From c05ea0a4b0b3563b90e81d375485ba9400da142f Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 4 Apr 2011 14:04:26 -0400 Subject: [PATCH] filled out drawConnect(), tweak colors --- SketchWidget.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/SketchWidget.py b/SketchWidget.py index 0262c2c..f9c77ee 100644 --- a/SketchWidget.py +++ b/SketchWidget.py @@ -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()