break out configurable sizes of things
This commit is contained in:
parent
bfe8d2a267
commit
3d002eebf8
@ -14,6 +14,11 @@ class SketchWidget:
|
|||||||
self.view_center = (0, 0)
|
self.view_center = (0, 0)
|
||||||
self.view_width = 4.0
|
self.view_width = 4.0
|
||||||
self.size = (1, 1)
|
self.size = (1, 1)
|
||||||
|
|
||||||
|
# Configuration parameters
|
||||||
|
self.line_size = 0.8
|
||||||
|
self.axis_size = 1.8
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# try double-buffered
|
# try double-buffered
|
||||||
self.glconfig = gtk.gdkgl.Config(mode = (gtk.gdkgl.MODE_RGB |
|
self.glconfig = gtk.gdkgl.Config(mode = (gtk.gdkgl.MODE_RGB |
|
||||||
@ -81,9 +86,9 @@ class SketchWidget:
|
|||||||
|
|
||||||
for shape in self.sketch:
|
for shape in self.sketch:
|
||||||
if isinstance(shape, Line):
|
if isinstance(shape, Line):
|
||||||
self.drawLine(shape, 1.5)
|
self.drawLine(shape, self.line_size)
|
||||||
elif isinstance(shape, Circle):
|
elif isinstance(shape, Circle):
|
||||||
self.drawCircle(shape, 1.5)
|
self.drawCircle(shape, self.line_size)
|
||||||
|
|
||||||
if gldrawable.is_double_buffered():
|
if gldrawable.is_double_buffered():
|
||||||
gldrawable.swap_buffers()
|
gldrawable.swap_buffers()
|
||||||
@ -166,6 +171,6 @@ class SketchWidget:
|
|||||||
glPushAttrib(GL_CURRENT_BIT)
|
glPushAttrib(GL_CURRENT_BIT)
|
||||||
glColor(1.0, 0.4, 0.4, 1.0)
|
glColor(1.0, 0.4, 0.4, 1.0)
|
||||||
cx, cy = self.ptToScreenPt((0, 0))
|
cx, cy = self.ptToScreenPt((0, 0))
|
||||||
self.drawFilledLine(cx - 25, cy, cx + 25, cy, 1.5)
|
self.drawFilledLine(cx - 25, cy, cx + 25, cy, self.axis_size)
|
||||||
self.drawFilledLine(cx, cy - 25, cx, cy + 25, 1.5)
|
self.drawFilledLine(cx, cy - 25, cx, cy + 25, self.axis_size)
|
||||||
glPopAttrib()
|
glPopAttrib()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user