diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-22 02:19:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-22 12:48:16 +0300 |
commit | 620b960d3d8cfd90b9f0df6ba3671c33eccb8309 (patch) | |
tree | 64f69db4bf9d44f0a32d1c92b0714bf2dc98ff2d /source/blender/editors/mask/mask_editaction.c | |
parent | bba60bb564cf5a16cfcac744d4ba82cf8eba3da9 (diff) |
Cleanup: style, use braces for editors
Diffstat (limited to 'source/blender/editors/mask/mask_editaction.c')
-rw-r--r-- | source/blender/editors/mask/mask_editaction.c | 60 |
1 files changed, 40 insertions, 20 deletions
diff --git a/source/blender/editors/mask/mask_editaction.c b/source/blender/editors/mask/mask_editaction.c index d30e62d89f5..985fa58cace 100644 --- a/source/blender/editors/mask/mask_editaction.c +++ b/source/blender/editors/mask/mask_editaction.c @@ -60,15 +60,17 @@ bool ED_masklayer_frames_looper(MaskLayer *masklay, MaskLayerShape *masklay_shape; /* error checker */ - if (masklay == NULL) + if (masklay == NULL) { return false; + } /* do loop */ for (masklay_shape = masklay->splines_shapes.first; masklay_shape; masklay_shape = masklay_shape->next) { /* execute callback */ - if (masklay_shape_cb(masklay_shape, scene)) + if (masklay_shape_cb(masklay_shape, scene)) { return true; + } } /* nothing to return */ @@ -85,8 +87,9 @@ void ED_masklayer_make_cfra_list(MaskLayer *masklay, ListBase *elems, bool onlys CfraElem *ce; /* error checking */ - if (ELEM(NULL, masklay, elems)) + if (ELEM(NULL, masklay, elems)) { return; + } /* loop through mask-frames, adding */ for (masklay_shape = masklay->splines_shapes.first; masklay_shape; @@ -111,14 +114,16 @@ bool ED_masklayer_frame_select_check(MaskLayer *masklay) MaskLayerShape *masklay_shape; /* error checking */ - if (masklay == NULL) + if (masklay == NULL) { return 0; + } /* stop at the first one found */ for (masklay_shape = masklay->splines_shapes.first; masklay_shape; masklay_shape = masklay_shape->next) { - if (masklay_shape->flag & MASK_SHAPE_SELECT) + if (masklay_shape->flag & MASK_SHAPE_SELECT) { return 1; + } } /* not found */ @@ -128,8 +133,9 @@ bool ED_masklayer_frame_select_check(MaskLayer *masklay) /* helper function - select mask-frame based on SELECT_* mode */ static void masklayshape_select(MaskLayerShape *masklay_shape, short select_mode) { - if (masklay_shape == NULL) + if (masklay_shape == NULL) { return; + } switch (select_mode) { case SELECT_ADD: @@ -150,8 +156,9 @@ void ED_mask_select_frames(MaskLayer *masklay, short select_mode) MaskLayerShape *masklay_shape; /* error checking */ - if (masklay == NULL) + if (masklay == NULL) { return; + } /* handle according to mode */ for (masklay_shape = masklay->splines_shapes.first; masklay_shape; @@ -164,8 +171,9 @@ void ED_mask_select_frames(MaskLayer *masklay, short select_mode) void ED_masklayer_frame_select_set(MaskLayer *masklay, short mode) { /* error checking */ - if (masklay == NULL) + if (masklay == NULL) { return; + } /* now call the standard function */ ED_mask_select_frames(masklay, mode); @@ -176,8 +184,9 @@ void ED_mask_select_frame(MaskLayer *masklay, int selx, short select_mode) { MaskLayerShape *masklay_shape; - if (masklay == NULL) + if (masklay == NULL) { return; + } masklay_shape = BKE_mask_layer_shape_find_frame(masklay, selx); @@ -191,14 +200,16 @@ void ED_masklayer_frames_select_box(MaskLayer *masklay, float min, float max, sh { MaskLayerShape *masklay_shape; - if (masklay == NULL) + if (masklay == NULL) { return; + } /* only select those frames which are in bounds */ for (masklay_shape = masklay->splines_shapes.first; masklay_shape; masklay_shape = masklay_shape->next) { - if (IN_RANGE(masklay_shape->frame, min, max)) + if (IN_RANGE(masklay_shape->frame, min, max)) { masklayshape_select(masklay_shape, select_mode); + } } } @@ -210,8 +221,9 @@ void ED_masklayer_frames_select_region(KeyframeEditData *ked, { MaskLayerShape *masklay_shape; - if (masklay == NULL) + if (masklay == NULL) { return; + } /* only select frames which are within the region */ for (masklay_shape = masklay->splines_shapes.first; masklay_shape; @@ -225,13 +237,15 @@ void ED_masklayer_frames_select_region(KeyframeEditData *ked, /* check the necessary regions */ if (tool == BEZT_OK_CHANNEL_LASSO) { /* Lasso */ - if (keyframe_region_lasso_test(ked->data, pt)) + if (keyframe_region_lasso_test(ked->data, pt)) { masklayshape_select(masklay_shape, select_mode); + } } else if (tool == BEZT_OK_CHANNEL_CIRCLE) { /* Circle */ - if (keyframe_region_circle_test(ked->data, pt)) + if (keyframe_region_circle_test(ked->data, pt)) { masklayshape_select(masklay_shape, select_mode); + } } } } @@ -246,8 +260,9 @@ bool ED_masklayer_frames_delete(MaskLayer *masklay) bool changed = false; /* error checking */ - if (masklay == NULL) + if (masklay == NULL) { return false; + } /* check for frames to delete */ for (masklay_shape = masklay->splines_shapes.first; masklay_shape; @@ -269,8 +284,9 @@ void ED_masklayer_frames_duplicate(MaskLayer *masklay) MaskLayerShape *masklay_shape, *gpfn; /* error checking */ - if (masklay == NULL) + if (masklay == NULL) { return; + } /* duplicate selected frames */ for (masklay_shape = masklay->splines_shapes.first; masklay_shape; masklay_shape = gpfn) { @@ -295,31 +311,35 @@ void ED_masklayer_frames_duplicate(MaskLayer *masklay) static short snap_masklayer_nearest(MaskLayerShape *masklay_shape, Scene *UNUSED(scene)) { - if (masklay_shape->flag & MASK_SHAPE_SELECT) + if (masklay_shape->flag & MASK_SHAPE_SELECT) { masklay_shape->frame = (int)(floor(masklay_shape->frame + 0.5)); + } return 0; } static short snap_masklayer_nearestsec(MaskLayerShape *masklay_shape, Scene *scene) { float secf = (float)FPS; - if (masklay_shape->flag & MASK_SHAPE_SELECT) + if (masklay_shape->flag & MASK_SHAPE_SELECT) { masklay_shape->frame = (int)(floorf(masklay_shape->frame / secf + 0.5f) * secf); + } return 0; } static short snap_masklayer_cframe(MaskLayerShape *masklay_shape, Scene *scene) { - if (masklay_shape->flag & MASK_SHAPE_SELECT) + if (masklay_shape->flag & MASK_SHAPE_SELECT) { masklay_shape->frame = (int)CFRA; + } return 0; } static short snap_masklayer_nearmarker(MaskLayerShape *masklay_shape, Scene *scene) { - if (masklay_shape->flag & MASK_SHAPE_SELECT) + if (masklay_shape->flag & MASK_SHAPE_SELECT) { masklay_shape->frame = (int)ED_markers_find_nearest_marker_time(&scene->markers, (float)masklay_shape->frame); + } return 0; } |