# HG changeset patch # User Eleni Maria Stea # Date 1408231501 -10800 # Node ID 3e4eb9a0d99999640ece00a17b74e55c10e158d9 # Parent 6d637706cfafe28aab96b26d1aef1459d1551bbe fixed t1, t2 selection with the mouse diff -r 6d637706cfaf -r 3e4eb9a0d999 src/main.cc --- a/src/main.cc Thu May 01 19:05:07 2014 +0300 +++ b/src/main.cc Sun Aug 17 02:25:01 2014 +0300 @@ -530,15 +530,23 @@ if(state == GLUT_DOWN) { int width = glutGet(GLUT_WINDOW_WIDTH); float xpos = (float)x / (float)width; - if(fabs(xpos - thres) <= fabs(xpos - thres2)) { + if(fabs(xpos - thres) <= fabs(xpos - thres2) && fabs(xpos - thres) < 0.1) { select_thres = &thres; } - else { + else if (fabs(xpos - thres2) < 0.1) { select_thres = &thres2; } - prev_select_thres = *select_thres; + else + select_thres = 0; + + if (select_thres) + prev_select_thres = *select_thres; } else { + if(!prev_select_thres || !select_thres) { + select_thres = 0; + return; + } if(fabs(*select_thres - prev_select_thres) > 0.001) { mesh->clear(); ui->sync_live();