diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2008-04-27 08:41:25 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2008-04-27 08:41:25 +0000 |
| commit | b6f3a85f48ac9433449dee4101980841ddd344f4 (patch) | |
| tree | 6bebdf585e31a6575a769a3a46b7070296f3778a /src/eraser-context.cpp | |
| parent | Fixed undo for eraser to be a single step (diff) | |
| download | inkscape-b6f3a85f48ac9433449dee4101980841ddd344f4.tar.gz inkscape-b6f3a85f48ac9433449dee4101980841ddd344f4.zip | |
Reduce undo history items when nothing is selected
(bzr r5529)
Diffstat (limited to 'src/eraser-context.cpp')
| -rw-r--r-- | src/eraser-context.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/eraser-context.cpp b/src/eraser-context.cpp index 3d142a9d0..c787f0799 100644 --- a/src/eraser-context.cpp +++ b/src/eraser-context.cpp @@ -790,6 +790,7 @@ static void set_to_accumulated(SPEraserContext *dc) { SPDesktop *desktop = SP_EVENT_CONTEXT(dc)->desktop; + bool workDone = false; if (!sp_curve_empty(dc->accumulated)) { NArtBpath *abp; @@ -838,6 +839,7 @@ set_to_accumulated(SPEraserContext *dc) selection->set(item); selection->add(dup); sp_selected_path_diff_skip_undo(); + workDone = true; // TODO set this only if something was cut. if ( !selection->isEmpty() ) { // If the item was not completely erased, add it back to the selection. GSList const *selected2 = g_slist_copy(const_cast<GSList *>(selection->itemList())); @@ -869,8 +871,13 @@ set_to_accumulated(SPEraserContext *dc) } } - sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_ERASER, - _("Draw eraser stroke")); + + if ( workDone ) { + sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_ERASER, + _("Draw eraser stroke")); + } else { + sp_document_cancel(sp_desktop_document(desktop)); + } } static void |
