diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-13 04:17:39 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-13 04:17:39 +0400 |
commit | 726a7d6cd46b9c7c2cc212980282d19727b12a23 (patch) | |
tree | 5d4292b6b9034c8c77eeeadb7069d21dbb000cff /source | |
parent | 880a86230f9dc48a41e3274661c0be847c407b90 (diff) |
bmesh: simplify mode check for setting the edge selection
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_marking.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/bmesh/intern/bmesh_marking.c b/source/blender/bmesh/intern/bmesh_marking.c index d66e478cf22..dfae7251c72 100644 --- a/source/blender/bmesh/intern/bmesh_marking.c +++ b/source/blender/bmesh/intern/bmesh_marking.c @@ -329,18 +329,15 @@ void BM_edge_select_set(BMesh *bm, BMEdge *e, const bool select) if (BM_elem_flag_test(e, BM_ELEM_SELECT)) bm->totedgesel -= 1; BM_elem_flag_disable(e, BM_ELEM_SELECT); - if (bm->selectmode == SCE_SELECT_EDGE || - bm->selectmode == SCE_SELECT_FACE || - bm->selectmode == (SCE_SELECT_EDGE | SCE_SELECT_FACE)) - { - + if ((bm->selectmode & SCE_SELECT_VERTEX) == 0) { BMIter iter; BMVert *verts[2] = {e->v1, e->v2}; BMEdge *e2; int i; + /* check if the vert is used by a selected edge */ for (i = 0; i < 2; i++) { - int deselect = 1; + bool deselect = true; for (e2 = BM_iter_new(&iter, bm, BM_EDGES_OF_VERT, verts[i]); e2; e2 = BM_iter_step(&iter)) { if (e2 == e) { @@ -348,7 +345,7 @@ void BM_edge_select_set(BMesh *bm, BMEdge *e, const bool select) } if (BM_elem_flag_test(e2, BM_ELEM_SELECT)) { - deselect = 0; + deselect = false; break; } } |