Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2008-03-09 06:41:13 +0300
committerJoshua Leung <aligorith@gmail.com>2008-03-09 06:41:13 +0300
commitac750cf7a28574f3f03e2d7b3519257dc02dc499 (patch)
tree7bca12aa6fb9704387b850b56fe8b3931f9be4b1 /source/blender/src/transform.c
parent6f1b47d6af4c30c46821a99d7ce4b8a4b3e3d186 (diff)
* Numeric input now works better for TimeSlide
* Removed a compiler warning
Diffstat (limited to 'source/blender/src/transform.c')
-rw-r--r--source/blender/src/transform.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c
index 0f0fe4697e0..b7bc6a2f027 100644
--- a/source/blender/src/transform.c
+++ b/source/blender/src/transform.c
@@ -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);