=== modified file 'src/live_effects/lpe-bendpath.cpp' --- src/live_effects/lpe-bendpath.cpp 2014-03-27 01:33:44 +0000 +++ src/live_effects/lpe-bendpath.cpp 2014-09-27 20:32:38 +0000 @@ -76,6 +76,9 @@ { // get the item bounding box original_bbox(lpeitem); + SPLPEItem * item = const_cast(lpeitem); + item->apply_to_clippath(item); + item->apply_to_mask(item); } Geom::Piecewise > === modified file 'src/live_effects/lpe-envelope.cpp' --- src/live_effects/lpe-envelope.cpp 2014-03-27 01:33:44 +0000 +++ src/live_effects/lpe-envelope.cpp 2014-09-27 20:33:42 +0000 @@ -32,7 +32,7 @@ bend_path2(_("Right bend path:"), _("Right path along which to bend the original path"), "bendpath2", &wr, this, "M0,0 L1,0"), bend_path3(_("Bottom bend path:"), _("Bottom path along which to bend the original path"), "bendpath3", &wr, this, "M0,0 L1,0"), bend_path4(_("Left bend path:"), _("Left path along which to bend the original path"), "bendpath4", &wr, this, "M0,0 L1,0"), - xx(_("E_nable left & right paths"), _("Enable the left and right deformation paths"), "xx", &wr, this, true), + xx(_("_Enable left & right paths"), _("Enable the left and right deformation paths"), "xx", &wr, this, true), yy(_("_Enable top & bottom paths"), _("Enable the top and bottom deformation paths"), "yy", &wr, this, true) { registerParameter( dynamic_cast(&yy) ); @@ -54,6 +54,9 @@ { // get the item bounding box original_bbox(lpeitem); + SPLPEItem * item = const_cast(lpeitem); + item->apply_to_clippath(item); + item->apply_to_mask(item); } Geom::Piecewise > === modified file 'src/live_effects/lpe-lattice.cpp' --- src/live_effects/lpe-lattice.cpp 2014-03-27 01:33:44 +0000 +++ src/live_effects/lpe-lattice.cpp 2014-09-27 20:40:12 +0000 @@ -176,6 +176,9 @@ LPELattice::doBeforeEffect (SPLPEItem const* lpeitem) { original_bbox(lpeitem); + SPLPEItem * item = const_cast(lpeitem); + item->apply_to_clippath(item); + item->apply_to_mask(item); } void === modified file 'src/live_effects/lpe-mirror_symmetry.cpp' --- src/live_effects/lpe-mirror_symmetry.cpp 2014-03-27 01:33:44 +0000 +++ src/live_effects/lpe-mirror_symmetry.cpp 2014-09-27 20:45:30 +0000 @@ -43,6 +43,14 @@ } void +LPEMirrorSymmetry::doBeforeEffect (SPLPEItem const* lpeitem) +{ + SPLPEItem * item = const_cast(lpeitem); + item->apply_to_clippath(item); + item->apply_to_mask(item); +} + +void LPEMirrorSymmetry::doOnApply (SPLPEItem const* lpeitem) { using namespace Geom; === modified file 'src/live_effects/lpe-mirror_symmetry.h' --- src/live_effects/lpe-mirror_symmetry.h 2014-03-27 01:33:44 +0000 +++ src/live_effects/lpe-mirror_symmetry.h 2014-09-27 20:42:43 +0000 @@ -30,6 +30,8 @@ virtual void doOnApply (SPLPEItem const* lpeitem); + virtual void doBeforeEffect (SPLPEItem const* lpeitem); + virtual std::vector doEffect_path (std::vector const & path_in); private: === modified file 'src/live_effects/lpe-offset.cpp' --- src/live_effects/lpe-offset.cpp 2014-03-27 01:33:44 +0000 +++ src/live_effects/lpe-offset.cpp 2014-09-27 20:46:09 +0000 @@ -55,6 +55,14 @@ pwd2.continuousConcat(cap_pwd2); } +void +LPEOffset::doBeforeEffect (SPLPEItem const* lpeitem) +{ + SPLPEItem * item = const_cast(lpeitem); + item->apply_to_clippath(item); + item->apply_to_mask(item); +} + Geom::Piecewise > LPEOffset::doEffect_pwd2 (Geom::Piecewise > const & pwd2_in) { === modified file 'src/live_effects/lpe-offset.h' --- src/live_effects/lpe-offset.h 2014-03-27 01:33:44 +0000 +++ src/live_effects/lpe-offset.h 2014-09-27 20:46:06 +0000 @@ -28,6 +28,8 @@ virtual void doOnApply (SPLPEItem const* lpeitem); + virtual void doBeforeEffect (SPLPEItem const* lpeitem); + virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); private: === modified file 'src/live_effects/lpe-perspective_path.cpp' --- src/live_effects/lpe-perspective_path.cpp 2014-08-20 21:53:23 +0000 +++ src/live_effects/lpe-perspective_path.cpp 2014-09-27 20:49:28 +0000 @@ -89,6 +89,9 @@ SP_LPE_ITEM(lpeitem)->removeCurrentPathEffect(false); return; } + SPLPEItem * item = const_cast(lpeitem); + item->apply_to_clippath(item); + item->apply_to_mask(item); } void LPEPerspectivePath::refresh(Gtk::Entry* perspective) { === modified file 'src/live_effects/lpe-vonkoch.cpp' --- src/live_effects/lpe-vonkoch.cpp 2014-05-15 22:18:42 +0000 +++ src/live_effects/lpe-vonkoch.cpp 2014-09-27 21:54:25 +0000 @@ -264,6 +264,9 @@ tmp_pathv.push_back(tmp_path); ref_path.set_new_value(tmp_pathv,true); } + SPLPEItem * item = const_cast(lpeitem); + item->apply_to_clippath(item); + item->apply_to_mask(item); } === modified file 'src/selection-chemistry.cpp' --- src/selection-chemistry.cpp 2014-09-12 18:56:00 +0000 +++ src/selection-chemistry.cpp 2014-09-27 09:56:35 +0000 @@ -3952,6 +3952,10 @@ for ( SPObject *child = obj->firstChild() ; child; child = child->getNext() ) { // Collect all clipped paths and masks within a single group Inkscape::XML::Node *copy = SP_OBJECT(child)->getRepr()->duplicate(xml_doc); + if(copy->attribute("inkscape:original-d")) + { + copy->setAttribute("d", copy->attribute("inkscape:original-d")); + } items_to_move = g_slist_prepend(items_to_move, copy); } === modified file 'src/sp-lpe-item.cpp' --- src/sp-lpe-item.cpp 2014-07-23 20:29:55 +0000 +++ src/sp-lpe-item.cpp 2014-09-27 22:56:33 +0000 @@ -56,7 +56,6 @@ static void sp_lpe_item_create_original_path_recursive(SPLPEItem *lpeitem); static void sp_lpe_item_cleanup_original_path_recursive(SPLPEItem *lpeitem); -static void sp_lpe_item_apply_to_clip_or_mask_group(SPGroup * group, SPItem * item); typedef std::list HRefList; static std::string patheffectlist_write_svg(PathEffectList const & list); @@ -341,6 +340,16 @@ { g_return_if_fail(lpeitem != NULL); + SPMask * mask = lpeitem->mask_ref->getObject(); + if(mask) + { + sp_lpe_item_create_original_path_recursive(SP_LPE_ITEM(mask->firstChild())); + } + SPClipPath * clipPath = lpeitem->clip_ref->getObject(); + if(clipPath) + { + sp_lpe_item_create_original_path_recursive(SP_LPE_ITEM(clipPath->firstChild())); + } if (SP_IS_GROUP(lpeitem)) { GSList const *item_list = sp_item_group_item_list(SP_GROUP(lpeitem)); for ( GSList const *iter = item_list; iter; iter = iter->next ) { @@ -364,6 +373,18 @@ g_return_if_fail(lpeitem != NULL); if (SP_IS_GROUP(lpeitem)) { + if (!lpeitem->hasPathEffectRecursive()) { + SPMask * mask = lpeitem->mask_ref->getObject(); + if(mask) + { + sp_lpe_item_cleanup_original_path_recursive(SP_LPE_ITEM(mask->firstChild())); + } + SPClipPath * clipPath = lpeitem->clip_ref->getObject(); + if(clipPath) + { + sp_lpe_item_cleanup_original_path_recursive(SP_LPE_ITEM(clipPath->firstChild())); + } + } GSList const *item_list = sp_item_group_item_list(SP_GROUP(lpeitem)); for ( GSList const *iter = item_list; iter; iter = iter->next ) { SPObject *subitem = static_cast(iter->data); @@ -375,6 +396,16 @@ else if (SP_IS_PATH(lpeitem)) { Inkscape::XML::Node *repr = lpeitem->getRepr(); if (!lpeitem->hasPathEffectRecursive() && repr->attribute("inkscape:original-d")) { + SPMask * mask = lpeitem->mask_ref->getObject(); + if(mask) + { + sp_lpe_item_cleanup_original_path_recursive(SP_LPE_ITEM(mask->firstChild())); + } + SPClipPath * clipPath = lpeitem->clip_ref->getObject(); + if(clipPath) + { + sp_lpe_item_cleanup_original_path_recursive(SP_LPE_ITEM(clipPath->firstChild())); + } repr->setAttribute("d", repr->attribute("inkscape:original-d")); repr->setAttribute("inkscape:original-d", NULL); } @@ -608,11 +639,8 @@ } } -//The next 3 functions are because the revert of the bug 1241902 -//for the moment not used - void -sp_lpe_item_apply_to_clippath(SPItem * item) +SPLPEItem::apply_to_clippath(SPItem *item) { SPClipPath *clipPath = item->clip_ref->getObject(); if(clipPath) { @@ -624,11 +652,18 @@ } else if(SP_IS_SHAPE(clip_data)) { clip_curve = SP_SHAPE(clip_data)->getCurve(); } else if(SP_IS_GROUP(clip_data)) { - sp_lpe_item_apply_to_clip_or_mask_group(SP_GROUP(clip_data), item); + apply_to_clip_or_mask_group(SP_ITEM(clip_data), item); return; } if(clip_curve) { - bool success = SP_LPE_ITEM(item)->performPathEffect(clip_curve); + bool success = false; + if(SP_IS_GROUP(this)){ + clip_curve->transform(i2anc_affine(SP_GROUP(item), SP_GROUP(this))); + success = this->performPathEffect(clip_curve); + clip_curve->transform(i2anc_affine(SP_GROUP(item), SP_GROUP(this)).inverse()); + } else { + success = this->performPathEffect(clip_curve); + } Inkscape::XML::Node *reprClip = clip_data->getRepr(); if (success) { gchar *str = sp_svg_write_path(clip_curve->get_pathvector()); @@ -648,10 +683,17 @@ clip_curve->unref(); } } + if(SP_IS_GROUP(item)){ + GSList const *item_list = sp_item_group_item_list(SP_GROUP(item)); + for ( GSList const *iter = item_list; iter; iter = iter->next ) { + SPObject *subitem = static_cast(iter->data); + apply_to_clippath(SP_ITEM(subitem)); + } + } } void -sp_lpe_item_apply_to_mask(SPItem * item) +SPLPEItem::apply_to_mask(SPItem *item) { SPMask *mask = item->mask_ref->getObject(); if(mask) { @@ -663,11 +705,18 @@ } else if(SP_IS_SHAPE(mask_data)) { mask_curve = SP_SHAPE(mask_data)->getCurve(); } else if(SP_IS_GROUP(mask_data)) { - sp_lpe_item_apply_to_clip_or_mask_group(SP_GROUP(mask_data), item); + apply_to_clip_or_mask_group(SP_ITEM(mask_data), item); return; } if(mask_curve) { - bool success = SP_LPE_ITEM(item)->performPathEffect(mask_curve); + bool success = false; + if(SP_IS_GROUP(this)){ + mask_curve->transform(i2anc_affine(SP_GROUP(item), SP_GROUP(this))); + success = this->performPathEffect(mask_curve); + mask_curve->transform(i2anc_affine(SP_GROUP(item), SP_GROUP(this)).inverse()); + } else { + success = this->performPathEffect(mask_curve); + } Inkscape::XML::Node *reprmask = mask_data->getRepr(); if (success) { gchar *str = sp_svg_write_path(mask_curve->get_pathvector()); @@ -687,16 +736,26 @@ mask_curve->unref(); } } + if(SP_IS_GROUP(item)){ + GSList const *item_list = sp_item_group_item_list(SP_GROUP(item)); + for ( GSList const *iter = item_list; iter; iter = iter->next ) { + SPObject *subitem = static_cast(iter->data); + apply_to_mask(SP_ITEM(subitem)); + } + } } -static void -sp_lpe_item_apply_to_clip_or_mask_group(SPGroup *group, SPItem *item) +void +SPLPEItem::apply_to_clip_or_mask_group(SPItem *group, SPItem *item) { - GSList *item_list = sp_item_group_item_list(group); + if (!SP_IS_GROUP(group)) { + return; + } + GSList *item_list = sp_item_group_item_list(SP_GROUP(group)); for ( GSList *iter = item_list; iter; iter = iter->next ) { SPObject *subitem = static_cast(iter->data); if (SP_IS_GROUP(subitem)) { - sp_lpe_item_apply_to_clip_or_mask_group(SP_GROUP(subitem), item); + apply_to_clip_or_mask_group(SP_ITEM(subitem), item); } else if (SP_IS_SHAPE(subitem)) { SPCurve * c = NULL; @@ -706,7 +765,14 @@ c = SP_SHAPE(subitem)->getCurve(); } if (c) { - bool success = SP_LPE_ITEM(item)->performPathEffect(c); + bool success = false; + if(SP_IS_GROUP(group)){ + c->transform(i2anc_affine(SP_GROUP(item), SP_GROUP(this))); + success = this->performPathEffect(c); + c->transform(i2anc_affine(SP_GROUP(item), SP_GROUP(this)).inverse()); + } else { + success = this->performPathEffect(c); + } Inkscape::XML::Node *repr = subitem->getRepr(); if (success) { gchar *str = sp_svg_write_path(c->get_pathvector()); === modified file 'src/sp-lpe-item.h' --- src/sp-lpe-item.h 2014-06-24 16:59:15 +0000 +++ src/sp-lpe-item.h 2014-09-27 17:33:45 +0000 @@ -91,14 +91,14 @@ void removeAllPathEffects(bool keep_paths); void addPathEffect(gchar *value, bool reset); void addPathEffect(LivePathEffectObject * new_lpeobj); - + void apply_to_mask(SPItem * item); + void apply_to_clippath(SPItem * item); + void apply_to_clip_or_mask_group(SPItem * group, SPItem * item); bool forkPathEffectsIfNecessary(unsigned int nr_of_allowed_users = 1); void editNextParamOncanvas(SPDesktop *dt); }; -void sp_lpe_item_apply_to_mask(SPItem * item); -void sp_lpe_item_apply_to_clippath(SPItem * item); void sp_lpe_item_update_patheffect (SPLPEItem *lpeitem, bool wholetree, bool write); // careful, class already has method with *very* similar name! #endif /* !SP_LPE_ITEM_H_SEEN */