diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-01-15 06:00:03 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-01-15 06:40:40 +0400 |
commit | b8b412230b1e1ed43295d5c299477a2cba73355e (patch) | |
tree | 0b3d61142c7a0490293c975a636165057f20c58e /source/blender/editors/animation/anim_ops.c | |
parent | e5c7535bebc37e04489fac4e88beca8cc5677d7d (diff) |
Code Cleanup: use iroundf
also increase precision of rctf print functions
Diffstat (limited to 'source/blender/editors/animation/anim_ops.c')
-rw-r--r-- | source/blender/editors/animation/anim_ops.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index af9b58736ef..48b310b57ed 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -35,6 +35,7 @@ #include "BLI_sys_types.h" #include "BLI_utildefines.h" +#include "BLI_math_base.h" #include "DNA_anim_types.h" #include "DNA_scene_types.h" @@ -126,7 +127,7 @@ static int frame_from_event(bContext *C, const wmEvent *event) UI_view2d_region_to_view(®ion->v2d, event->mval[0], event->mval[1], &viewx, NULL); /* round result to nearest int (frames are ints!) */ - frame = (int)floor(viewx + 0.5f); + frame = iroundf(viewx); if (scene->r.flag & SCER_LOCK_FRAME_SELECTION) { CLAMP(frame, PSFRA, PEFRA); @@ -223,8 +224,8 @@ static int previewrange_define_exec(bContext *C, wmOperator *op) if (efra < sfra) efra = sfra; scene->r.flag |= SCER_PRV_RANGE; - scene->r.psfra = (int)floor(sfra + 0.5f); - scene->r.pefra = (int)floor(efra + 0.5f); + scene->r.psfra = iroundf(sfra); + scene->r.pefra = iroundf(efra); /* send notifiers */ WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene); |