diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-09-10 10:20:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-09-10 10:20:08 +0400 |
commit | 6480fdcae4c722468c87570b81e321c518fcbe53 (patch) | |
tree | 1789625a8c95a97dcfdc75c64841b469a4aacd08 /source/blender | |
parent | 652eaf7723de34b7b717a7fe2fb4a5757614fb0a (diff) |
Cancel edge-rip macro if no changes are made.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/mesh/editmesh_rip_edge.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/editors/mesh/editmesh_rip_edge.c b/source/blender/editors/mesh/editmesh_rip_edge.c index 9ffdd715616..5daf33fae3b 100644 --- a/source/blender/editors/mesh/editmesh_rip_edge.c +++ b/source/blender/editors/mesh/editmesh_rip_edge.c @@ -63,6 +63,7 @@ static int edbm_rip_edge_invoke(bContext *C, wmOperator *UNUSED(op), const wmEve const float mval_fl[2] = {UNPACK2(event->mval)}; float cent_sco[2]; int cent_tot; + bool changed = false; /* mouse direction to view center */ float mval_dir[2]; @@ -211,17 +212,24 @@ found_edge: BM_edge_select_set(bm, e_best, true); } BM_elem_flag_enable(v_new, BM_ELEM_TAG); /* prevent further splitting */ + + changed = true; } } } - BM_select_history_clear(bm); + if (changed) { + BM_select_history_clear(bm); - BM_mesh_select_mode_flush(bm); + BM_mesh_select_mode_flush(bm); - EDBM_update_generic(em, true, true); + EDBM_update_generic(em, true, true); - return OPERATOR_FINISHED; + return OPERATOR_FINISHED; + } + else { + return OPERATOR_CANCELLED; + } } |