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:
Diffstat (limited to 'source/blender/editors/animation/anim_ops.c')
-rw-r--r--source/blender/editors/animation/anim_ops.c7
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(&region->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);