selecting keyframes in the ipo view didn't work well when zoomed in far, use pixel...
authorCampbell Barton <ideasman42@gmail.com>
Mon, 21 Jan 2008 00:41:29 +0000 (00:41 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 21 Jan 2008 00:41:29 +0000 (00:41 +0000)
source/blender/src/editipo.c

index 07b97ccf75fe12aaf2f2189b8524cf06078caee7..612d9f59b9252e3fe9a7346da2af66a48731bf43 100644 (file)
@@ -1476,6 +1476,9 @@ void mouse_select_ipo(void)
        }
        
        if(G.sipo->showkey) {
+               float pixelwidth;
+               pixelwidth= (G.v2d->cur.xmax-G.v2d->cur.xmin)/(G.v2d->mask.xmax-G.v2d->mask.xmin); /* could make a generic function */
+               
                getmouseco_areawin(mval);
                
                areamouseco_to_ipoco(G.v2d, mval, &x, &y);
@@ -1484,7 +1487,7 @@ void mouse_select_ipo(void)
                ik= G.sipo->ipokey.first;
                while(ik) {
                        dist= (float)(fabs(ik->val-x));
-                       if(ik->flag & 1) dist+= 1.0;
+                       if(ik->flag & SELECT) dist+= pixelwidth;
                        if(dist < mindist) {
                                actik= ik;
                                mindist= dist;