summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-11-17 21:27:06 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-11-17 21:27:06 +0000
commitd2417aa8fb6f6945faccd0ba4a19337c509329b6 (patch)
treeb4747af84b3a45d2cde2fa278d4772fcfd2cfb75 /src
parentFixes crash with perspective_lpe (diff)
downloadinkscape-d2417aa8fb6f6945faccd0ba4a19337c509329b6.tar.gz
inkscape-d2417aa8fb6f6945faccd0ba4a19337c509329b6.zip
fix a bug in bspline on apply on non shapes
(bzr r13726)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/lpe-bspline.cpp21
-rw-r--r--src/live_effects/lpe-bspline.h2
2 files changed, 5 insertions, 18 deletions
diff --git a/src/live_effects/lpe-bspline.cpp b/src/live_effects/lpe-bspline.cpp
index 97a4c6205..c5390a0c9 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);
}
}
diff --git a/src/live_effects/lpe-bspline.h b/src/live_effects/lpe-bspline.h
index 8751a5720..a17c0c4ac 100644
--- a/src/live_effects/lpe-bspline.h
+++ b/src/live_effects/lpe-bspline.h
@@ -19,10 +19,10 @@ public:
LPEBSpline(LivePathEffectObject *lpeobject);
virtual ~LPEBSpline();
- virtual void createAndApply(const char *name, SPDocument *doc, SPItem *item);
virtual LPEPathFlashType pathFlashType() const {
return SUPPRESS_FLASH;
}
+ virtual void doOnApply(SPLPEItem const* lpeitem);
virtual void doEffect(SPCurve *curve);
virtual void doBeforeEffect (SPLPEItem const* lpeitem);
void drawHandle(Geom::Point p, double radiusHelperNodes);