- make pick scenes always use particularly thick lines so that the line picking behavior is relayed to the mouse-over highlight

Sat, 17 May 2014 02:00:02 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Sat, 17 May 2014 02:00:02 +0300
changeset 772
e117509e1b51
parent 771
0f04e34bec54
child 773
6eb3c88982ac

- make pick scenes always use particularly thick lines so that the line picking behavior is relayed to the mouse-over highlight

src/glCompiler.cc file | annotate | diff | comparison | revisions
src/glRenderer.cc file | annotate | diff | comparison | revisions
--- a/src/glCompiler.cc	Fri May 16 21:59:03 2014 +0300
+++ b/src/glCompiler.cc	Sat May 17 02:00:02 2014 +0300
@@ -311,7 +311,7 @@
 {
 //	print ("Compile %1\n", g_objectOrigins[obj]);
 
-	if (obj == null || obj->document()->isImplicit())
+	if (obj == null || obj->document() == null || obj->document()->isImplicit())
 		return;
 
 	ObjectVBOInfo info;
--- a/src/glRenderer.cc	Fri May 16 21:59:03 2014 +0300
+++ b/src/glRenderer.cc	Sat May 17 02:00:02 2014 +0300
@@ -1215,9 +1215,6 @@
 {
 	makeCurrent();
 
-	// Use particularly thick lines while picking ease up selecting lines.
-	glLineWidth (max<double> (cfg::lineThickness, 6.5f));
-
 	// Clear the selection if we do not wish to add to it.
 	if (not m_addpick)
 	{
@@ -1323,9 +1320,6 @@
 	if (removedObj)
 		compileObject (removedObj);
 
-	// Restore line thickness
-	glLineWidth (cfg::lineThickness);
-
 	setPicking (false);
 	m_rangepick = false;
 	repaint();
@@ -1402,10 +1396,20 @@
 	m_isPicking = a;
 	setBackground();
 
-	if (a)
+	if (isPicking())
+	{
 		glDisable (GL_DITHER);
+
+		// Use particularly thick lines while picking ease up selecting lines.
+		glLineWidth (max<double> (cfg::lineThickness, 6.5));
+	}
 	else
+	{
 		glEnable (GL_DITHER);
+
+		// Restore line thickness
+		glLineWidth (cfg::lineThickness);
+	}
 }
 
 // =============================================================================

mercurial