From 1e983a931816b7c601bb6641039de0414640d969 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 18 Jan 2010 00:45:33 +0000 Subject: DopeSheet Keyframe/NLA Strip Scaling Tool: Scaling behaviour relative to mouse movement was inverted. Made the this transform tool now use the standard input mechanism for scaling inputs so that the behaviour is now correct. Martin: In my tests, the responsiveness of the scale tool is now not sensitive enough though. If you have some time, could you look into whether this can be made to work a bit freer? --- source/blender/editors/transform/transform.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'source/blender/editors/transform/transform.c') diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index e8e7e323496..09fce29cbc7 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -5451,9 +5451,9 @@ void initTimeScale(TransInfo *t) { t->mode = TFM_TIME_SCALE; t->transform = TimeScale; - - initMouseInputMode(t, &t->mouse, INPUT_NONE); - t->helpline = HLP_SPRING; /* set manually because we don't use a predefined input */ + + // TODO: the scaling ratios obtained here aren't rapid enough + initMouseInputMode(t, &t->mouse, INPUT_SPRING_FLIP); t->flag |= T_NULL_ONE; t->num.flag |= NUM_NULL_ONE; @@ -5521,19 +5521,8 @@ static void applyTimeScale(TransInfo *t) { int TimeScale(TransInfo *t, short mval[2]) { - float cval, sval; - float deltax, startx; - float width= 0.0f; char str[200]; - - sval= t->imval[0]; - cval= mval[0]; - - /* calculate scaling factor */ - startx= sval-(width/2+(t->ar->winx)/2); - deltax= cval-(width/2+(t->ar->winx)/2); - t->values[0] = deltax / startx; - + /* handle numeric-input stuff */ t->vec[0] = t->values[0]; applyNumInput(&t->num, &t->vec[0]); -- cgit v1.2.3