individual constraint drawing routines responsible for setting color
This commit is contained in:
parent
65f80774a1
commit
c7885bc0d6
@ -287,7 +287,6 @@ class SketchWidget:
|
|||||||
self.drawCircle(shape)
|
self.drawCircle(shape)
|
||||||
|
|
||||||
def drawConstraints(self):
|
def drawConstraints(self):
|
||||||
glColor(*self.constraint_color)
|
|
||||||
for c in self.sketch.constraints:
|
for c in self.sketch.constraints:
|
||||||
if isinstance(c, Connect):
|
if isinstance(c, Connect):
|
||||||
self.drawConnect(c)
|
self.drawConnect(c)
|
||||||
@ -297,10 +296,12 @@ class SketchWidget:
|
|||||||
self.drawVertical(c)
|
self.drawVertical(c)
|
||||||
|
|
||||||
def drawConnect(self, con):
|
def drawConnect(self, con):
|
||||||
|
glColor(*self.constraint_color)
|
||||||
pt = self.ptToScreenPt(con.shape1.getPt(con.pt1))
|
pt = self.ptToScreenPt(con.shape1.getPt(con.pt1))
|
||||||
self.drawHandle(pt[0], pt[1])
|
self.drawHandle(pt[0], pt[1])
|
||||||
|
|
||||||
def drawHandle(self, x, y):
|
def drawHandle(self, x, y):
|
||||||
|
glColor(*self.constraint_color)
|
||||||
self.drawFilledCircle(x, y, self.line_width, 4)
|
self.drawFilledCircle(x, y, self.line_width, 4)
|
||||||
s = self.line_width * 2
|
s = self.line_width * 2
|
||||||
glBegin(GL_LINE_LOOP)
|
glBegin(GL_LINE_LOOP)
|
||||||
@ -311,6 +312,7 @@ class SketchWidget:
|
|||||||
glEnd()
|
glEnd()
|
||||||
|
|
||||||
def drawHorizontal(self, con):
|
def drawHorizontal(self, con):
|
||||||
|
glColor(*self.constraint_color)
|
||||||
l = 15.0
|
l = 15.0
|
||||||
glPushAttrib(GL_LINE_BIT)
|
glPushAttrib(GL_LINE_BIT)
|
||||||
glEnable(GL_LINE_STIPPLE)
|
glEnable(GL_LINE_STIPPLE)
|
||||||
@ -326,6 +328,7 @@ class SketchWidget:
|
|||||||
glPopAttrib()
|
glPopAttrib()
|
||||||
|
|
||||||
def drawVertical(self, con):
|
def drawVertical(self, con):
|
||||||
|
glColor(*self.constraint_color)
|
||||||
l = 15.0
|
l = 15.0
|
||||||
glPushAttrib(GL_LINE_BIT)
|
glPushAttrib(GL_LINE_BIT)
|
||||||
glEnable(GL_LINE_STIPPLE)
|
glEnable(GL_LINE_STIPPLE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user