* Numeric input now works better for TimeSlide

* Removed a compiler warning
This commit is contained in:
Joshua Leung
2008-03-09 03:41:13 +00:00
parent 6f1b47d6af
commit ac750cf7a2
2 changed files with 7 additions and 4 deletions

View File

@@ -50,6 +50,7 @@ void snap_sel_to_curs(void);
void snap_curs_to_grid(void);
void snap_curs_to_sel(void);
void snap_to_center(void);
void snap_curs_to_active(void);
#endif /* BSE_EDIT_H */

View File

@@ -4397,21 +4397,23 @@ static void applyTimeSlide(TransInfo *t, float sval)
int TimeSlide(TransInfo *t, short mval[2])
{
float cval[2], sval[2];
float minx= *((float *)(t->customData));
float maxx= *((float *)(t->customData) + 1);
char str[200];
/* calculate mouse co-ordinates */
areamouseco_to_ipoco(G.v2d, mval, &cval[0], &cval[1]);
areamouseco_to_ipoco(G.v2d, t->imval, &sval[0], &sval[1]);
/* calculate fake value to work with */
/* t->fac stores cval[0], which is the current mouse-pointer location (in frames) */
t->fac= cval[0];
/* handle numeric-input stuff */
t->vec[0] = t->fac;
t->vec[0] = 2.0*(cval[0]-sval[0]) / (maxx-minx);
applyNumInput(&t->num, &t->vec[0]);
t->fac = t->vec[0];
headerTimeSlide(t, sval[0], str);
t->fac = (maxx-minx) * t->vec[0] / 2.0 + sval[0];
headerTimeSlide(t, sval[0], str);
applyTimeSlide(t, sval[0]);
recalcData(t);