summaryrefslogtreecommitdiffstats
path: root/src/selection-chemistry.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2012-01-18 20:13:58 +0000
committerJohan Engelen <goejendaagh@zonnet.nl>2012-01-18 20:13:58 +0000
commitce16f79bc2ea0ce81dae35382767a880e495fe9a (patch)
tree7490df119e73a65f50bbc383816fbe96129fbfc5 /src/selection-chemistry.cpp
parentdocumentation (diff)
downloadinkscape-ce16f79bc2ea0ce81dae35382767a880e495fe9a.tar.gz
inkscape-ce16f79bc2ea0ce81dae35382767a880e495fe9a.zip
select referred path when pressing shift+d (select original) for a path with Clone original LPE
(bzr r10905)
Diffstat (limited to 'src/selection-chemistry.cpp')
-rw-r--r--src/selection-chemistry.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index 97bc5a39f..bc4b7ca98 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -91,6 +91,10 @@ SPCycleType SP_CYCLING = SP_CYCLE_FOCUS;
#include "path-chemistry.h"
#include "ui/tool/control-point-selection.h"
#include "ui/tool/multi-path-manipulator.h"
+#include "sp-lpe-item.h"
+#include "live_effects/effect.h"
+#include "live_effects/effect-enum.h"
+#include "live_effects/parameter/originalpath.h"
#include "enums.h"
#include "sp-item-group.h"
@@ -2226,7 +2230,17 @@ sp_select_clone_original(SPDesktop *desktop)
original = sp_textpath_get_path_item(SP_TEXTPATH(item->firstChild()));
} else if (SP_IS_FLOWTEXT(item)) {
original = SP_FLOWTEXT(item)->get_frame(NULL); // first frame only
- } else { // it's an object that we don't know what to do with
+ } else if (SP_IS_LPE_ITEM(item)) {
+ // check if the applied LPE is Clone original, if so, go to the refered path
+ Inkscape::LivePathEffect::Effect* lpe = sp_lpe_item_has_path_effect_of_type(SP_LPE_ITEM(item), Inkscape::LivePathEffect::CLONE_ORIGINAL);
+ if (lpe) {
+ Inkscape::LivePathEffect::Parameter *lpeparam = lpe->getParameter("linkedpath");
+ if (Inkscape::LivePathEffect::OriginalPathParam *pathparam = dynamic_cast<Inkscape::LivePathEffect::OriginalPathParam *>(lpeparam)) {
+ original = pathparam->getObject();
+ }
+ }
+ }
+ if (original == NULL) { // it's an object that we don't know what to do with
desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, error);
return;
}