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/util | |
parent | bba60bb564cf5a16cfcac744d4ba82cf8eba3da9 (diff) |
Cleanup: style, use braces for editors
Diffstat (limited to 'source/blender/editors/util')
-rw-r--r-- | source/blender/editors/util/ed_transverts.c | 27 | ||||
-rw-r--r-- | source/blender/editors/util/ed_util.c | 12 |
2 files changed, 26 insertions, 13 deletions
diff --git a/source/blender/editors/util/ed_transverts.c b/source/blender/editors/util/ed_transverts.c index 4cc74bec7d9..f054d09094d 100644 --- a/source/blender/editors/util/ed_transverts.c +++ b/source/blender/editors/util/ed_transverts.c @@ -74,8 +74,9 @@ void ED_transverts_update_obedit(TransVertStore *tvs, Object *obedit) while (a--) { if (bezt->hide == 0) { bool skip_handle = false; - if (bezt->f2 & SELECT) + if (bezt->f2 & SELECT) { skip_handle = (mode & TM_SKIP_HANDLES) != 0; + } if ((bezt->f1 & SELECT) && !skip_handle) { BLI_assert(tv->loc == bezt->vec[0]); @@ -131,8 +132,9 @@ void ED_transverts_update_obedit(TransVertStore *tvs, Object *obedit) add_v3_v3(ebo->tail, diffvec); a++; - if (a < tvs->transverts_tot) + if (a < tvs->transverts_tot) { tv++; + } } } } @@ -150,14 +152,16 @@ void ED_transverts_update_obedit(TransVertStore *tvs, Object *obedit) } } } - if (arm->flag & ARM_MIRROR_EDIT) + if (arm->flag & ARM_MIRROR_EDIT) { ED_armature_edit_transform_mirror_update(obedit); + } } else if (obedit->type == OB_LATTICE) { Lattice *lt = obedit->data; - if (lt->editlatt->latt->flag & LT_OUTSIDE) + if (lt->editlatt->latt->flag & LT_OUTSIDE) { outside_lattice(lt->editlatt->latt); + } } } @@ -247,8 +251,9 @@ void ED_transverts_create_from_obedit(TransVertStore *tvs, Object *obedit, const } BM_ITER_MESH (eve, &iter, bm, BM_VERTS_OF_MESH) { - if (BM_elem_index_get(eve) == TM_INDEX_ON) + if (BM_elem_index_get(eve) == TM_INDEX_ON) { tvs->transverts_tot++; + } } } else { @@ -270,8 +275,9 @@ void ED_transverts_create_from_obedit(TransVertStore *tvs, Object *obedit, const } BM_ITER_MESH (eve, &iter, bm, BM_VERTS_OF_MESH) { - if (BM_elem_index_get(eve) == TM_INDEX_ON) + if (BM_elem_index_get(eve) == TM_INDEX_ON) { tvs->transverts_tot++; + } } } /* for any of the 3 loops above which all dirty the indices */ @@ -363,10 +369,12 @@ void ED_transverts_create_from_obedit(TransVertStore *tvs, Object *obedit, const ListBase *nurbs = BKE_curve_editNurbs_get(cu); for (nu = nurbs->first; nu; nu = nu->next) { - if (nu->type == CU_BEZIER) + if (nu->type == CU_BEZIER) { totmalloc += 3 * nu->pntsu; - else + } + else { totmalloc += nu->pntsu * nu->pntsv; + } } tv = tvs->transverts = MEM_callocN(totmalloc * sizeof(TransVert), __func__); @@ -378,8 +386,9 @@ void ED_transverts_create_from_obedit(TransVertStore *tvs, Object *obedit, const while (a--) { if (bezt->hide == 0) { bool skip_handle = false; - if (bezt->f2 & SELECT) + if (bezt->f2 & SELECT) { skip_handle = (mode & TM_SKIP_HANDLES) != 0; + } if ((bezt->f1 & SELECT) && !skip_handle) { copy_v3_v3(tv->oldloc, bezt->vec[0]); diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index ccaa0d68475..867271229e2 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -271,20 +271,24 @@ void apply_keyb_grid( int shift, int ctrl, float *val, float fac1, float fac2, float fac3, int invert) { /* fac1 is for 'nothing', fac2 for CTRL, fac3 for SHIFT */ - if (invert) + if (invert) { ctrl = !ctrl; + } if (ctrl && shift) { - if (fac3 != 0.0f) + if (fac3 != 0.0f) { *val = fac3 * floorf(*val / fac3 + 0.5f); + } } else if (ctrl) { - if (fac2 != 0.0f) + if (fac2 != 0.0f) { *val = fac2 * floorf(*val / fac2 + 0.5f); + } } else { - if (fac1 != 0.0f) + if (fac1 != 0.0f) { *val = fac1 * floorf(*val / fac1 + 0.5f); + } } } |