summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-powerclip.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/live_effects/lpe-powerclip.cpp')
-rw-r--r--src/live_effects/lpe-powerclip.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/live_effects/lpe-powerclip.cpp b/src/live_effects/lpe-powerclip.cpp
index 40a9cdbfb..18276270d 100644
--- a/src/live_effects/lpe-powerclip.cpp
+++ b/src/live_effects/lpe-powerclip.cpp
@@ -395,6 +395,25 @@ LPEPowerClip::flattenClip(SPItem * clip_data, Geom::PathVector &path_in)
}
}
+void sp_inverse_powerclip(Inkscape::Selection *sel) {
+ if (!sel->isEmpty()) {
+ auto selList = sel->items();
+ for(auto i = boost::rbegin(selList); i != boost::rend(selList); ++i) {
+ SPLPEItem* lpeitem = dynamic_cast<SPLPEItem*>(*i);
+ if (lpeitem) {
+ Effect::createAndApply(POWERCLIP, SP_ACTIVE_DOCUMENT, lpeitem);
+ Effect* lpe = lpeitem->getCurrentLPE();
+ lpe->getRepr()->setAttribute("is_inverse", "false");
+ lpe->getRepr()->setAttribute("is_visible", "true");
+ lpe->getRepr()->setAttribute("inverse", "true");
+ lpe->getRepr()->setAttribute("flatten", "false");
+ lpe->getRepr()->setAttribute("hide_clip", "false");
+ dynamic_cast<LPEPowerClip *>(lpe)->convertShapes();
+ }
+ }
+ }
+}
+
}; //namespace LivePathEffect
}; /* namespace Inkscape */