diff options
author | Campbell Barton <ideasman42@gmail.com> | 2006-01-29 11:01:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2006-01-29 11:01:04 +0300 |
commit | 904e298dc1d86119a4ae9c798cdb4a8784a969ef (patch) | |
tree | 78efab31c7779d40b4ca7e262113b7b0427fb0bb /source/blender/src | |
parent | 5953857f927c40d4661a5af0fc45cb5b98381c09 (diff) |
Small edit so undo+redraw is only done when removeDoubles actually does somthing.
Would anyone have a problem with me going through and making functions like triangulate, flip normals tri2quad etc all return how many changes made? - then undo+redraw can be done only when needed.
Diffstat (limited to 'source/blender/src')
-rw-r--r-- | source/blender/src/buttons_editing.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index e3fbb984761..04f11bc6318 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -3058,7 +3058,7 @@ void do_meshbuts(unsigned short event) Mesh *me; float fac; short randfac; - + int count; /* store num of changes made to see if redraw & undo are needed*/ ob= OBACT; if(ob && ob->type==OB_MESH) { @@ -3183,10 +3183,13 @@ void do_meshbuts(unsigned short event) G.f -= G_DISABLE_OK; break; case B_REMDOUB: - notice("Removed: %d", removedoublesflag(1, G.scene->toolsettings->doublimit)); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Rem Doubles"); + count= removedoublesflag(1, G.scene->toolsettings->doublimit); + notice("Removed: %d", count); + if (count) { /* only undo and redraw if an action is taken */ + DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); + allqueue(REDRAWVIEW3D, 0); + BIF_undo_push("Rem Doubles"); + } break; case B_SUBDIV: waitcursor(1); |