summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiam P. White <inkscapebronyat-signgmaildotcom>2014-04-02 00:40:15 +0000
committerLiam P. White <inkscapebronyat-signgmaildotcom>2014-04-02 00:40:15 +0000
commitf3e0966f95dc4284b1fd191fb4c187c92c24aeed (patch)
tree7c72531904ecce784c011cdc47d87e5c2209fdec /src
parentFix bug 1219324 (diff)
downloadinkscape-f3e0966f95dc4284b1fd191fb4c187c92c24aeed.tar.gz
inkscape-f3e0966f95dc4284b1fd191fb4c187c92c24aeed.zip
Fix some stuff
(bzr r13090.1.41)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/effect.cpp10
-rw-r--r--src/live_effects/effect.h3
-rw-r--r--src/sp-lpe-item.cpp13
3 files changed, 23 insertions, 3 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp
index 337fe631f..8bf210270 100644
--- a/src/live_effects/effect.cpp
+++ b/src/live_effects/effect.cpp
@@ -5,7 +5,7 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#define LPE_ENABLE_TEST_EFFECTS //uncomment for toy effects
+//#define LPE_ENABLE_TEST_EFFECTS //uncomment for toy effects
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -365,6 +365,14 @@ Effect::doBeforeEffect (SPLPEItem const*/*lpeitem*/)
//Do nothing for simple effects
}
+void Effect::doAfterEffect (SPLPEItem const* lpeitem)
+{
+}
+
+void Effect::doOnRemove (SPLPEItem const* lpeitem)
+{
+}
+
/**
* Effects can have a parameter path set before they are applied by accepting a nonzero number of
* mouse clicks. This method activates the pen context, which waits for the specified number of
diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h
index 1da9b4cc9..85c930def 100644
--- a/src/live_effects/effect.h
+++ b/src/live_effects/effect.h
@@ -55,6 +55,9 @@ public:
virtual void doOnApply (SPLPEItem const* lpeitem);
virtual void doBeforeEffect (SPLPEItem const* lpeitem);
+
+ virtual void doAfterEffect (SPLPEItem const* lpeitem);
+ virtual void doOnRemove (SPLPEItem const* lpeitem);
void writeParamsToSVG();
diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp
index 6324af147..71aa9545a 100644
--- a/src/sp-lpe-item.cpp
+++ b/src/sp-lpe-item.cpp
@@ -16,6 +16,9 @@
# include "config.h"
#endif
+//the gtk devs are really not smart about backwards compatibility
+#include "ui/tool/multi-path-manipulator.h"
+
#include <glibmm/i18n.h>
#include "live_effects/effect.h"
@@ -39,7 +42,6 @@
#include "tools-switch.h"
#include "ui/tools/node-tool.h"
#include "ui/tools/tool-base.h"
-#include "ui/tool/multi-path-manipulator.h"
#include <algorithm>
@@ -254,6 +256,9 @@ bool SPLPEItem::performPathEffect(SPCurve *curve) {
}
return false;
}
+ if (!SP_IS_GROUP(this)) {
+ lpe->doAfterEffect(this);
+ }
}
}
}
@@ -447,11 +452,15 @@ void SPLPEItem::removeCurrentPathEffect(bool keep_paths)
Inkscape::LivePathEffect::LPEObjectReference* lperef = this->getCurrentLPEReference();
if (!lperef)
return;
-
+
+ Inkscape::LivePathEffect::Effect * lpe = this->getCurrentLPE();
+ lpe->doOnRemove(this);
+
PathEffectList new_list = *this->path_effect_list;
new_list.remove(lperef); //current lpe ref is always our 'own' pointer from the path_effect_list
std::string r = patheffectlist_write_svg(new_list);
+
if (!r.empty()) {
this->getRepr()->setAttribute("inkscape:path-effect", r.c_str());
} else {