diff options
Diffstat (limited to 'source/blender/editors/transform/transform.c')
-rw-r--r-- | source/blender/editors/transform/transform.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 496488922a5..fea6f7266b2 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -5554,7 +5554,7 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, TransData2D *td2d, else #endif { - val= floorf(val+0.5f); + val = floor(val + 0.5); } /* convert frame out of nla-action time */ @@ -5640,7 +5640,7 @@ static void headerTimeTranslate(TransInfo *t, char *str) /* apply snapping + frame->seconds conversions */ if (autosnap == SACTSNAP_STEP) { if (do_time) - val= floorf((double)val/secf + 0.5f); + val= floorf((double)val / secf + 0.5); else val= floorf(val + 0.5f); } @@ -5688,9 +5688,9 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval)) if (autosnap == SACTSNAP_STEP) { if (do_time) - deltax= (float)(floor((deltax/secf) + 0.5f) * secf); + deltax = (float)(floor(((double)deltax / secf) + 0.5) * secf); else - deltax= (float)(floor(deltax + 0.5f)); + deltax = (float)(floor(deltax + 0.5f)); } val = BKE_nla_tweakedit_remap(adt, td->ival, NLATIME_CONVERT_MAP); @@ -5702,9 +5702,9 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval)) if (autosnap == SACTSNAP_STEP) { if (do_time) - val= (float)(floor((deltax/secf) + 0.5f) * secf); + val = (float)(floor(((double)deltax / secf) + 0.5) * secf); else - val= (float)(floor(val + 0.5f)); + val = (float)(floor(val + 0.5f)); } *(td->val) = td->ival + val; @@ -5954,9 +5954,9 @@ static void applyTimeScale(TransInfo *t) if (autosnap == SACTSNAP_STEP) { if (do_time) - fac= (float)(floor(fac/secf + 0.5f) * secf); + fac = (float)(floor((double)fac / secf + 0.5) * secf); else - fac= (float)(floor(fac + 0.5f)); + fac = (float)(floor(fac + 0.5f)); } /* check if any need to apply nla-mapping */ @@ -5964,9 +5964,7 @@ static void applyTimeScale(TransInfo *t) startx= BKE_nla_tweakedit_remap(adt, startx, NLATIME_CONVERT_UNMAP); /* now, calculate the new value */ - *(td->val) = td->ival - startx; - *(td->val) *= fac; - *(td->val) += startx; + *(td->val) = ((td->ival - startx) * fac) + startx; /* apply nearest snapping */ doAnimEdit_SnapFrame(t, td, td2d, adt, autosnap); |