diff options
Diffstat (limited to 'src/object')
| -rwxr-xr-x | src/object/sp-lpe-item.cpp | 12 | ||||
| -rw-r--r-- | src/object/sp-lpe-item.h | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/object/sp-lpe-item.cpp b/src/object/sp-lpe-item.cpp index f3dd5f05b..b43a0b926 100755 --- a/src/object/sp-lpe-item.cpp +++ b/src/object/sp-lpe-item.cpp @@ -1152,9 +1152,19 @@ void SPLPEItem::replacePathEffects( std::vector<LivePathEffectObject const *> co * use this method instead. * Returns true if one or more effects were forked; returns false if nothing was done. */ -bool SPLPEItem::forkPathEffectsIfNecessary(unsigned int nr_of_allowed_users) +bool SPLPEItem::forkPathEffectsIfNecessary(unsigned int nr_of_allowed_users, bool recursive) { bool forked = false; + SPGroup * group = dynamic_cast<SPGroup *>(this); + if (group && recursive) { + std::vector<SPItem*> item_list = sp_item_group_item_list(group); + for (auto child:item_list) { + SPLPEItem *lpeitem = dynamic_cast<SPLPEItem *>(child); + if (lpeitem && lpeitem->forkPathEffectsIfNecessary(nr_of_allowed_users, recursive)) { + forked = true; + } + } + } if ( this->hasPathEffect() ) { // If one of the path effects is used by 2 or more items, fork it diff --git a/src/object/sp-lpe-item.h b/src/object/sp-lpe-item.h index 55e32dad6..6ebd01fe3 100644 --- a/src/object/sp-lpe-item.h +++ b/src/object/sp-lpe-item.h @@ -99,7 +99,7 @@ public: void applyToMask(SPItem* to, Inkscape::LivePathEffect::Effect *lpe = nullptr); void applyToClipPath(SPItem* to, Inkscape::LivePathEffect::Effect *lpe = nullptr); void applyToClipPathOrMask(SPItem * clip_mask, SPItem* to, Inkscape::LivePathEffect::Effect *lpe = nullptr); - bool forkPathEffectsIfNecessary(unsigned int nr_of_allowed_users = 1); + bool forkPathEffectsIfNecessary(unsigned int nr_of_allowed_users = 1, bool recursive = true); void editNextParamOncanvas(SPDesktop *dt); }; |
