summaryrefslogtreecommitdiffstats
path: root/src/ui/tools/eraser-tool.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2016-10-24 22:58:43 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2016-10-24 22:58:43 +0000
commit532f77b14a76fc04e6bdeca3625f9a55b5f11bdf (patch)
treeb70df28300f24edde9b04d0c7704c11c295c4c62 /src/ui/tools/eraser-tool.cpp
parent[Bug #1636086] Update Catalan translation for Inkscape 0.92. (diff)
downloadinkscape-532f77b14a76fc04e6bdeca3625f9a55b5f11bdf.tar.gz
inkscape-532f77b14a76fc04e6bdeca3625f9a55b5f11bdf.zip
CPPification: almost all sp_object_set_whatever and sp_selection_whatever global functions are now methods of ObjectSet*, with these additional benefits:
- They can now act on any SelectionSet, not just the current selection; - Whenever possible, they don't need a desktop anymore and can run if called from GUI. I hope I did not break too many things in the process. *: So instead of callink sp_selection_move(desktop,x,y), you call myobjectset->move(x,y) (bzr r15189)
Diffstat (limited to 'src/ui/tools/eraser-tool.cpp')
-rw-r--r--src/ui/tools/eraser-tool.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ui/tools/eraser-tool.cpp b/src/ui/tools/eraser-tool.cpp
index 12686160b..4f941e534 100644
--- a/src/ui/tools/eraser-tool.cpp
+++ b/src/ui/tools/eraser-tool.cpp
@@ -732,10 +732,10 @@ void EraserTool::set_to_accumulated() {
workDone = true; // TODO set this only if something was cut.
bool break_apart = prefs->getBool("/tools/eraser/break_apart", false);
if(!break_apart){
- sp_selected_path_combine(this->desktop, true);
+ selection->combine(true);
} else {
if(!this->nowidth){
- sp_selected_path_break_apart(this->desktop, true);
+ selection->breakApart(true);
}
}
if ( !selection->isEmpty() ) {
@@ -784,7 +784,7 @@ void EraserTool::set_to_accumulated() {
sp_object_ref(clip_path, 0);
clip_path->deleteObject(true);
sp_object_unref(clip_path);
- sp_selection_raise_to_top(selection, this->desktop, true);
+ selection->raiseToTop(true);
selection->add(dup_clip);
sp_selected_path_diff_skip_undo(selection);
SPItem * clip = SP_ITEM(*(selection->items().begin()));
@@ -800,13 +800,13 @@ void EraserTool::set_to_accumulated() {
rect->transform = SP_ITEM(rect->parent)->i2dt_affine().inverse();
rect->updateRepr();
rect->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
- sp_selection_raise_to_top(selection, this->desktop, true);
+ selection->raiseToTop(true);
selection->add(rect);
sp_selected_path_diff_skip_undo(selection);
}
- sp_selection_raise_to_top(selection, this->desktop, true);
+ selection->raiseToTop(true);
selection->add(item);
- sp_selection_set_mask(this->desktop, true, false, true);
+ selection->setMask(true, false, true);
} else {
SPItem *erase_clip = selection->singleItem();
if (erase_clip) {
@@ -836,7 +836,7 @@ void EraserTool::set_to_accumulated() {
}
if (eraser_mode == ERASER_MODE_DELETE) {
- sp_selection_delete(this->desktop);
+ selection->deleteItems();
remainingItems.clear();
}