summaryrefslogtreecommitdiffstats
path: root/src/live_effects
diff options
context:
space:
mode:
Diffstat (limited to 'src/live_effects')
-rw-r--r--src/live_effects/lpe-powerclip.cpp19
-rw-r--r--src/live_effects/lpe-powerclip.h2
-rw-r--r--src/live_effects/lpe-powermask.cpp18
-rw-r--r--src/live_effects/lpe-powermask.h3
4 files changed, 42 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 */
diff --git a/src/live_effects/lpe-powerclip.h b/src/live_effects/lpe-powerclip.h
index 38485b798..6f99d220f 100644
--- a/src/live_effects/lpe-powerclip.h
+++ b/src/live_effects/lpe-powerclip.h
@@ -38,6 +38,8 @@ private:
bool convert_shapes;
};
+void sp_inverse_powerclip(Inkscape::Selection *sel);
+
} //namespace LivePathEffect
} //namespace Inkscape
#endif
diff --git a/src/live_effects/lpe-powermask.cpp b/src/live_effects/lpe-powermask.cpp
index 0d48b1b77..883467b6a 100644
--- a/src/live_effects/lpe-powermask.cpp
+++ b/src/live_effects/lpe-powermask.cpp
@@ -303,6 +303,24 @@ LPEPowerMask::doOnRemove (SPLPEItem const* lpeitem)
}
}
+void sp_inverse_powermask(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(POWERMASK, SP_ACTIVE_DOCUMENT, lpeitem);
+ Effect* lpe = lpeitem->getCurrentLPE();
+ lpe->getRepr()->setAttribute("invert", "false");
+ lpe->getRepr()->setAttribute("is_visible", "true");
+ lpe->getRepr()->setAttribute("hide_mask", "false");
+ lpe->getRepr()->setAttribute("background", "true");
+ lpe->getRepr()->setAttribute("background_color", "#ffffffff");
+ }
+ }
+ }
+}
+
}; //namespace LivePathEffect
}; /* namespace Inkscape */
diff --git a/src/live_effects/lpe-powermask.h b/src/live_effects/lpe-powermask.h
index eb2640867..e81b34fe3 100644
--- a/src/live_effects/lpe-powermask.h
+++ b/src/live_effects/lpe-powermask.h
@@ -36,6 +36,9 @@ private:
guint32 previous_color;
};
+void sp_inverse_powermask(Inkscape::Selection *sel);
+
} //namespace LivePathEffect
} //namespace Inkscape
+
#endif