diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-02-03 11:08:25 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-02-03 11:08:25 +0300 |
commit | af2d75b9a7299cfbf641ce7b9d759af335cd00c0 (patch) | |
tree | 7ddad5888490f6d3768371aa9b61904c1b56a031 /source/blender/bmesh/intern | |
parent | faaaf7ee1f030b9b47e14c9787e9da5b0e78f08c (diff) |
cleanup: inconsistent BMesh select checks
Diffstat (limited to 'source/blender/bmesh/intern')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_marking.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/source/blender/bmesh/intern/bmesh_marking.c b/source/blender/bmesh/intern/bmesh_marking.c index 0f198b11f42..ffbd2bf4f91 100644 --- a/source/blender/bmesh/intern/bmesh_marking.c +++ b/source/blender/bmesh/intern/bmesh_marking.c @@ -342,8 +342,8 @@ void BM_vert_select_set(BMesh *bm, BMVert *v, const bool select) if (select) { if (!BM_elem_flag_test(v, BM_ELEM_SELECT)) { - bm->totvertsel += 1; BM_elem_flag_enable(v, BM_ELEM_SELECT); + bm->totvertsel += 1; } } else { @@ -368,15 +368,18 @@ void BM_edge_select_set(BMesh *bm, BMEdge *e, const bool select) } if (select) { - if (!BM_elem_flag_test(e, BM_ELEM_SELECT)) bm->totedgesel += 1; - - BM_elem_flag_enable(e, BM_ELEM_SELECT); + if (!BM_elem_flag_test(e, BM_ELEM_SELECT)) { + BM_elem_flag_enable(e, BM_ELEM_SELECT); + bm->totedgesel += 1; + } BM_vert_select_set(bm, e->v1, true); BM_vert_select_set(bm, e->v2, true); } else { - if (BM_elem_flag_test(e, BM_ELEM_SELECT)) bm->totedgesel -= 1; - BM_elem_flag_disable(e, BM_ELEM_SELECT); + if (BM_elem_flag_test(e, BM_ELEM_SELECT)) { + BM_elem_flag_disable(e, BM_ELEM_SELECT); + bm->totedgesel -= 1; + } if ((bm->selectmode & SCE_SELECT_VERTEX) == 0) { int i; @@ -427,10 +430,10 @@ void BM_face_select_set(BMesh *bm, BMFace *f, const bool select) if (select) { if (!BM_elem_flag_test(f, BM_ELEM_SELECT)) { - bm->totfacesel++; + BM_elem_flag_enable(f, BM_ELEM_SELECT); + bm->totfacesel += 1; } - BM_elem_flag_enable(f, BM_ELEM_SELECT); l_iter = l_first = BM_FACE_FIRST_LOOP(f); do { BM_vert_select_set(bm, l_iter->v, true); @@ -441,8 +444,10 @@ void BM_face_select_set(BMesh *bm, BMFace *f, const bool select) BMIter liter; BMLoop *l; - if (BM_elem_flag_test(f, BM_ELEM_SELECT)) bm->totfacesel -= 1; - BM_elem_flag_disable(f, BM_ELEM_SELECT); + if (BM_elem_flag_test(f, BM_ELEM_SELECT)) { + BM_elem_flag_disable(f, BM_ELEM_SELECT); + bm->totfacesel -= 1; + } /* flush down to edges */ BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) { |