src/glRenderer.cc

changeset 772
e117509e1b51
parent 768
29e6c5552388
child 784
f82ab4d3c7b4
equal deleted inserted replaced
771:0f04e34bec54 772:e117509e1b51
1213 // 1213 //
1214 void GLRenderer::pick (int mouseX, int mouseY) 1214 void GLRenderer::pick (int mouseX, int mouseY)
1215 { 1215 {
1216 makeCurrent(); 1216 makeCurrent();
1217 1217
1218 // Use particularly thick lines while picking ease up selecting lines.
1219 glLineWidth (max<double> (cfg::lineThickness, 6.5f));
1220
1221 // Clear the selection if we do not wish to add to it. 1218 // Clear the selection if we do not wish to add to it.
1222 if (not m_addpick) 1219 if (not m_addpick)
1223 { 1220 {
1224 LDObjectList oldsel = selection(); 1221 LDObjectList oldsel = selection();
1225 getCurrentDocument()->clearSelection(); 1222 getCurrentDocument()->clearSelection();
1321 compileObject (obj); 1318 compileObject (obj);
1322 1319
1323 if (removedObj) 1320 if (removedObj)
1324 compileObject (removedObj); 1321 compileObject (removedObj);
1325 1322
1326 // Restore line thickness
1327 glLineWidth (cfg::lineThickness);
1328
1329 setPicking (false); 1323 setPicking (false);
1330 m_rangepick = false; 1324 m_rangepick = false;
1331 repaint(); 1325 repaint();
1332 } 1326 }
1333 1327
1400 void GLRenderer::setPicking (const bool& a) 1394 void GLRenderer::setPicking (const bool& a)
1401 { 1395 {
1402 m_isPicking = a; 1396 m_isPicking = a;
1403 setBackground(); 1397 setBackground();
1404 1398
1405 if (a) 1399 if (isPicking())
1400 {
1406 glDisable (GL_DITHER); 1401 glDisable (GL_DITHER);
1402
1403 // Use particularly thick lines while picking ease up selecting lines.
1404 glLineWidth (max<double> (cfg::lineThickness, 6.5));
1405 }
1407 else 1406 else
1407 {
1408 glEnable (GL_DITHER); 1408 glEnable (GL_DITHER);
1409
1410 // Restore line thickness
1411 glLineWidth (cfg::lineThickness);
1412 }
1409 } 1413 }
1410 1414
1411 // ============================================================================= 1415 // =============================================================================
1412 // 1416 //
1413 Matrix GLRenderer::getCircleDrawMatrix (double scale) 1417 Matrix GLRenderer::getCircleDrawMatrix (double scale)

mercurial