Mouse-click in the ipo/action/timeline/.. to change the frame

used to round down, and select the previous frame even when
the mouse was very close to the next one. Now it snaps to the
closest frame instead.
This commit is contained in:
Brecht Van Lommel
2008-02-06 17:43:32 +00:00
parent a003d87a24
commit c9932c7da8
5 changed files with 6 additions and 6 deletions

View File

@@ -4272,7 +4272,7 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
getmouseco_areawin(mval);
areamouseco_to_ipoco(G.v2d, mval, &dx, &dy);
cfra= (int)dx;
cfra= (int)(dx+0.5f);
if (cfra < 1) cfra= 1;
if (cfra != CFRA) {

View File

@@ -1936,7 +1936,7 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
areamouseco_to_ipoco(G.v2d, mval, &dx, &dy);
cfra= (int)dx;
cfra= (int)(dx+0.5f);
if(cfra< 1) cfra= 1;
if( cfra!=CFRA ) {

View File

@@ -143,7 +143,7 @@ void winqreadsoundspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
getmouseco_areawin(mval);
areamouseco_to_ipoco(G.v2d, mval, &dx, &dy);
cfra = (int)dx;
cfra = (int)(dx+0.5f);
if(cfra< 1) cfra= 1;
if( cfra!=CFRA || first )

View File

@@ -856,7 +856,7 @@ void winqreadtimespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
getmouseco_areawin(mval);
areamouseco_to_ipoco(G.v2d, mval, &dx, &dy);
cfra = (int)dx;
cfra = (int)(dx+0.5f);
if(cfra< MINFRAME) cfra= MINFRAME;
if( cfra!=CFRA || first )

View File

@@ -2837,7 +2837,7 @@ static void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
getmouseco_areawin(mval);
areamouseco_to_ipoco(v2d, mval, &dx, &dy);
cfra = get_cfra_from_dx(sipo, (int)dx);
cfra = get_cfra_from_dx(sipo, (int)(dx+0.5f));
if(cfra< 1) cfra= 1;
if( cfra!=CFRA ) {
@@ -4644,7 +4644,7 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
getmouseco_areawin(mval);
areamouseco_to_ipoco(v2d, mval, &dx, &dy);
cfra= (int)dx;
cfra= (int)(dx+0.5f);
if(cfra< 1) cfra= 1;
/* else if(cfra> EFRA) cfra= EFRA; */