summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2017-12-15 21:07:03 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2017-12-15 21:07:03 +0000
commitba0b9ea53558d3a09d005592969260f1fe3f5a17 (patch)
treeef070263a82275000eb480b855dcd51f1bd49fcd /src
parentMerge branch 'master' into powerpencilII (diff)
parentFix typos (diff)
downloadinkscape-ba0b9ea53558d3a09d005592969260f1fe3f5a17.tar.gz
inkscape-ba0b9ea53558d3a09d005592969260f1fe3f5a17.zip
Merge branch 'master' into powerpencilII
Diffstat (limited to 'src')
-rw-r--r--src/path-chemistry.cpp21
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp5
-rw-r--r--src/ui/dialog/inkscape-preferences.h1
-rw-r--r--src/verbs.cpp9
4 files changed, 26 insertions, 10 deletions
diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp
index b824d15c7..9e75b7841 100644
--- a/src/path-chemistry.cpp
+++ b/src/path-chemistry.cpp
@@ -55,7 +55,7 @@ ObjectSet::combine(bool skip_undo)
{
//Inkscape::Selection *selection = desktop->getSelection();
SPDocument *doc = document();
-
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
std::vector<SPItem*> items_copy(items().begin(), items().end());
if (items_copy.size() < 1) {
@@ -299,14 +299,17 @@ void ObjectSet::toCurves(bool skip_undo)
desktop()->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select <b>object(s)</b> to convert to path."));
return;
}
-
+
bool did = false;
if (desktop()) {
desktop()->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Converting objects to paths..."));
// set "busy" cursor
desktop()->setWaitingCursor();
}
-
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ if (prefs->getBool("/options/pathoperationsunlink/value", true)) {
+ unlinkRecursive(true);
+ }
std::vector<SPItem*> selected(items().begin(), items().end());
std::vector<Inkscape::XML::Node*> to_select;
clear();
@@ -337,7 +340,10 @@ void ObjectSet::toLPEItems()
if (isEmpty()) {
return;
}
-
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ if (prefs->getBool("/options/pathoperationsunlink/value", true)) {
+ unlinkRecursive(true);
+ }
std::vector<SPItem*> selected(items().begin(), items().end());
std::vector<Inkscape::XML::Node*> to_select;
clear();
@@ -366,12 +372,7 @@ sp_item_list_to_curves(const std::vector<SPItem*> &items, std::vector<SPItem*>&
{
continue;
}
- //TODO: decide if we want to unlink clones or not, for now keep previous functionality retaining clones as is
- SPUse *use = dynamic_cast<SPUse *>(item);
- if (use) {
- continue;
- }
-
+
SPPath *path = dynamic_cast<SPPath *>(item);
if (path && !path->_curve_before_lpe) {
// remove connector attributes
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index 74774f8f4..d75b22ddb 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -1375,6 +1375,11 @@ void InkscapePreferences::initPageBehavior()
_page_clones.add_line(true, "", _clone_relink_on_duplicate, "",
_("When duplicating a selection containing both a clone and its original (possibly in groups), relink the duplicated clone to the duplicated original instead of the old original"));
+ _page_clones.add_group_header( _("Unlinking clones"));
+ _clone_to_curves.init ( _("Path operations unlink clones"), "/options/pathoperationsunlink/value", true);
+ _page_clones.add_line(true, "", _clone_to_curves, "",
+ _("The following path operations will unlink clones: Stroke to path, Object to path, Boolean operations, Combine, Break apart"));
+
//TRANSLATORS: Heading for the Inkscape Preferences "Clones" Page
this->AddPage(_page_clones, _("Clones"), iter_behavior, PREFS_PAGE_BEHAVIOR_CLONES);
diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h
index 7cfe3695c..f7c5cc971 100644
--- a/src/ui/dialog/inkscape-preferences.h
+++ b/src/ui/dialog/inkscape-preferences.h
@@ -272,6 +272,7 @@ protected:
UI::Widget::PrefRadioButton _clone_option_unlink;
UI::Widget::PrefRadioButton _clone_option_delete;
UI::Widget::PrefCheckButton _clone_relink_on_duplicate;
+ UI::Widget::PrefCheckButton _clone_to_curves;
UI::Widget::PrefCheckButton _mask_mask_on_top;
UI::Widget::PrefCheckButton _mask_mask_remove;
diff --git a/src/verbs.cpp b/src/verbs.cpp
index f01a3c79c..212fcf357 100644
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
@@ -1125,21 +1125,27 @@ void SelectionVerb::perform(SPAction *action, void *data)
bool handled = true;
switch (reinterpret_cast<std::size_t>(data)) {
case SP_VERB_SELECTION_UNION:
+ selection->toCurves(true);
selection->pathUnion();
break;
case SP_VERB_SELECTION_INTERSECT:
+ selection->toCurves(true);
selection->pathIntersect();
break;
case SP_VERB_SELECTION_DIFF:
+ selection->toCurves(true);
selection->pathDiff();
break;
case SP_VERB_SELECTION_SYMDIFF:
+ selection->toCurves(true);
selection->pathSymDiff();
break;
case SP_VERB_SELECTION_CUT:
+ selection->toCurves(true);
selection->pathCut();
break;
case SP_VERB_SELECTION_SLICE:
+ selection->toCurves(true);
selection->pathSlice();
break;
case SP_VERB_SELECTION_GROW:
@@ -1253,6 +1259,7 @@ void SelectionVerb::perform(SPAction *action, void *data)
tools_switch(dt, TOOLS_NODES);
break;
case SP_VERB_SELECTION_OUTLINE:
+ selection->toCurves(true);
sp_selected_path_outline(dt);
break;
case SP_VERB_SELECTION_OUTLINE_LEGACY:
@@ -1281,9 +1288,11 @@ void SelectionVerb::perform(SPAction *action, void *data)
break;
case SP_VERB_SELECTION_COMBINE:
+ selection->toCurves(true);
selection->combine();
break;
case SP_VERB_SELECTION_BREAK_APART:
+ selection->toCurves(true);
selection->breakApart();
break;
case SP_VERB_SELECTION_ARRANGE: