diff options
Diffstat (limited to 'source/blender/editors/transform/transform.c')
-rw-r--r-- | source/blender/editors/transform/transform.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index be33dfd5e20..f8e529aa4bf 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -7591,7 +7591,7 @@ static void headerTimeTranslate(TransInfo *t, char str[MAX_INFO_LEN]) } } -static void applyTimeTranslateValue(TransInfo *t, float UNUSED(sval)) +static void applyTimeTranslateValue(TransInfo *t) { TransData *td = t->data; TransData2D *td2d = t->data2d; @@ -7649,15 +7649,17 @@ static void applyTimeTranslateValue(TransInfo *t, float UNUSED(sval)) static void applyTimeTranslate(TransInfo *t, const int mval[2]) { View2D *v2d = (View2D *)t->view; - float cval[2], sval[2]; char str[MAX_INFO_LEN]; /* calculate translation amount from mouse movement - in 'time-grid space' */ - UI_view2d_region_to_view(v2d, mval[0], mval[0], &cval[0], &cval[1]); - UI_view2d_region_to_view(v2d, t->imval[0], t->imval[0], &sval[0], &sval[1]); + if (t->flag & T_MODAL) { + float cval[2], sval[2]; + UI_view2d_region_to_view(v2d, mval[0], mval[0], &cval[0], &cval[1]); + UI_view2d_region_to_view(v2d, t->imval[0], t->imval[0], &sval[0], &sval[1]); - /* we only need to calculate effect for time (applyTimeTranslate only needs that) */ - t->values[0] = cval[0] - sval[0]; + /* we only need to calculate effect for time (applyTimeTranslate only needs that) */ + t->values[0] = cval[0] - sval[0]; + } /* handle numeric-input stuff */ t->vec[0] = t->values[0]; @@ -7665,7 +7667,7 @@ static void applyTimeTranslate(TransInfo *t, const int mval[2]) t->values[0] = t->vec[0]; headerTimeTranslate(t, str); - applyTimeTranslateValue(t, sval[0]); + applyTimeTranslateValue(t); recalcData(t); |