diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2012-01-18 20:13:58 +0000 |
|---|---|---|
| committer | Johan Engelen <goejendaagh@zonnet.nl> | 2012-01-18 20:13:58 +0000 |
| commit | ce16f79bc2ea0ce81dae35382767a880e495fe9a (patch) | |
| tree | 7490df119e73a65f50bbc383816fbe96129fbfc5 /src | |
| parent | documentation (diff) | |
| download | inkscape-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')
| -rw-r--r-- | src/live_effects/parameter/originalpath.h | 3 | ||||
| -rw-r--r-- | src/selection-chemistry.cpp | 16 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/live_effects/parameter/originalpath.h b/src/live_effects/parameter/originalpath.h index e56dbf2df..f05f17d9a 100644 --- a/src/live_effects/parameter/originalpath.h +++ b/src/live_effects/parameter/originalpath.h @@ -24,7 +24,8 @@ public: Effect* effect); virtual ~OriginalPathParam(); - bool linksToPath() { return (href != NULL); } + bool linksToPath() const { return (href != NULL); } + SPItem * getObject() const { return ref.getObject(); } virtual Gtk::Widget * param_newWidget(); /** Disable the canvas indicators of parent class by overriding this method */ 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; } |
