summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-bspline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/live_effects/lpe-bspline.cpp')
-rw-r--r--src/live_effects/lpe-bspline.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/live_effects/lpe-bspline.cpp b/src/live_effects/lpe-bspline.cpp
index 97a4c6205..2bed90139 100644
--- a/src/live_effects/lpe-bspline.cpp
+++ b/src/live_effects/lpe-bspline.cpp
@@ -88,25 +88,12 @@ void LPEBSpline::doBeforeEffect (SPLPEItem const* /*lpeitem*/)
}
-void LPEBSpline::createAndApply(const char *name, SPDocument *doc,
- SPItem *item)
+void LPEBSpline::doOnApply(SPLPEItem const* lpeitem)
{
- if (!SP_IS_SHAPE(item)) {
+ if (!SP_IS_SHAPE(lpeitem)) {
g_warning("LPE BSpline can only be applied to shapes (not groups).");
- } else {
- // Path effect definition
- Inkscape::XML::Document *xml_doc = doc->getReprDoc();
- Inkscape::XML::Node *repr = xml_doc->createElement("inkscape:path-effect");
- repr->setAttribute("effect", name);
-
- doc->getDefs()->getRepr()
- ->addChild(repr, NULL); // adds to <defs> and assigns the 'id' attribute
- const gchar *repr_id = repr->attribute("id");
- Inkscape::GC::release(repr);
-
- gchar *href = g_strdup_printf("#%s", repr_id);
- SP_LPE_ITEM(item)->addPathEffect(href, true);
- g_free(href);
+ SPLPEItem * item = const_cast<SPLPEItem*>(lpeitem);
+ item->removeCurrentPathEffect(false);
}
}
@@ -380,6 +367,7 @@ void LPEBSpline::doBSplineFromWidget(SPCurve *curve, double weightValue)
{
using Geom::X;
using Geom::Y;
+
if (curve->get_segment_count() < 1)
return;
// Make copy of old path as it is changed during processing