From 8e8734dc15e614586f9b4963b69671ce16d5c137 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Fri, 30 May 2008 20:36:13 +0000 Subject: LPE STACKING! (many thanks to the french students who made this.) (bzr r5766) --- src/ui/clipboard.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/ui/clipboard.cpp') diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index fff6e3b09..2d38f5ccd 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -61,6 +61,7 @@ #include "sp-textpath.h" #include "sp-rect.h" #include "live_effects/lpeobject.h" +#include "live_effects/lpeobject-reference.h" #include "live_effects/parameter/path.h" #include "svg/svg.h" // for sp_svg_transform_write, used in _copySelection #include "svg/css-ostringstream.h" // used in _parseColor @@ -560,10 +561,14 @@ void ClipboardManagerImpl::_copyUsedDefs(SPItem *item) } } // For lpe items, copy liveeffect if applicable + // TODO: copy the whole effect stack. now it only copies current selected effect if (SP_IS_LPE_ITEM(item)) { SPLPEItem *lpeitem = SP_LPE_ITEM (item); if (sp_lpe_item_has_path_effect(lpeitem)) { - _copyNode(SP_OBJECT_REPR(SP_OBJECT(sp_lpe_item_get_livepatheffectobject(lpeitem))), _doc, _defs); + Inkscape::LivePathEffect::LPEObjectReference* lperef = sp_lpe_item_get_current_lpereference(lpeitem); + if (lperef && lperef->lpeobject) { + _copyNode(SP_OBJECT_REPR(SP_OBJECT(lperef->lpeobject)), _doc, _defs); + } } } // For 3D boxes, copy perspectives @@ -900,7 +905,7 @@ void ClipboardManagerImpl::_applyPathEffect(SPItem *item, gchar const *effect) if (!obj) return; // if the effect is not used by anyone, we might as well take it LivePathEffectObject *lpeobj = LIVEPATHEFFECT(obj)->fork_private_if_necessary(1); - sp_lpe_item_set_path_effect(lpeitem, lpeobj); + sp_lpe_item_add_path_effect(lpeitem, lpeobj); } } -- cgit v1.2.3