From 355bfa5bf4d51f9d8c3fddf910a73ec7958d9a8a Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Tue, 1 Apr 2014 18:38:26 -0400 Subject: Fix bug 1219324 (bzr r13090.1.40) --- src/sp-lpe-item.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/sp-lpe-item.cpp') diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index 666c79e49..6324af147 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -36,6 +36,10 @@ #include "desktop.h" #include "shape-editor.h" #include "sp-ellipse.h" +#include "tools-switch.h" +#include "ui/tools/node-tool.h" +#include "ui/tools/tool-base.h" +#include "ui/tool/multi-path-manipulator.h" #include @@ -416,6 +420,17 @@ void SPLPEItem::addPathEffect(gchar *value, bool reset) // Apply the path effect sp_lpe_item_update_patheffect(this, true, true); + + //fix bug 1219324 + Inkscape::UI::Tools::NodeTool *tool = 0; + if (SP_ACTIVE_DESKTOP ) { + Inkscape::UI::Tools::ToolBase *ec = SP_ACTIVE_DESKTOP->event_context; + if (INK_IS_NODE_TOOL(ec)) { + tool = static_cast(ec); + tools_switch(SP_ACTIVE_DESKTOP, TOOLS_LPETOOL); //mhh + tools_switch(SP_ACTIVE_DESKTOP, TOOLS_NODES); + } + } } } -- cgit v1.2.3 From f3e0966f95dc4284b1fd191fb4c187c92c24aeed Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Tue, 1 Apr 2014 20:40:15 -0400 Subject: Fix some stuff (bzr r13090.1.41) --- src/sp-lpe-item.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/sp-lpe-item.cpp') 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 #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 @@ -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 { -- cgit v1.2.3 From 4007abe02509fc1e312a007fb26f31c5a595df26 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Thu, 3 Apr 2014 21:04:51 -0400 Subject: Begin first stage of resolving issue with duplicate knots (bzr r13090.1.46) --- src/sp-lpe-item.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/sp-lpe-item.cpp') diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index 71aa9545a..eda34a0b5 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -553,6 +553,7 @@ bool SPLPEItem::hasBrokenPathEffect() const bool SPLPEItem::hasPathEffect() const { + if (!path_effect_list) return false; //nullptr sucks if (path_effect_list->empty()) { return false; } @@ -698,6 +699,7 @@ PathEffectList const SPLPEItem::getEffectList() const Inkscape::LivePathEffect::LPEObjectReference* SPLPEItem::getCurrentLPEReference() { + if (!this->hasPathEffect()) return NULL; if (!this->current_path_effect && !this->path_effect_list->empty()) { setCurrentPathEffect(this->path_effect_list->back()); } @@ -707,6 +709,9 @@ Inkscape::LivePathEffect::LPEObjectReference* SPLPEItem::getCurrentLPEReference( Inkscape::LivePathEffect::Effect* SPLPEItem::getCurrentLPE() { + if (path_effect_list == NULL) { + return NULL; + } Inkscape::LivePathEffect::LPEObjectReference* lperef = getCurrentLPEReference(); if (lperef && lperef->lpeobject) -- cgit v1.2.3 From 6f10c7f675fae8c20f24f01b7cffb861f3726e9d Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sun, 6 Apr 2014 17:38:30 -0400 Subject: Properly allow effect stacking with knotholders (and add extra LPE functionality) (bzr r13090.1.48) --- src/sp-lpe-item.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sp-lpe-item.cpp') diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index eda34a0b5..712a0d579 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -242,7 +242,7 @@ bool SPLPEItem::performPathEffect(SPCurve *curve) { // Groups have their doBeforeEffect called elsewhere if (!SP_IS_GROUP(this)) { - lpe->doBeforeEffect(this); + lpe->doBeforeEffect_impl(this); } try { @@ -414,7 +414,7 @@ void SPLPEItem::addPathEffect(gchar *value, bool reset) } // perform this once when the effect is applied - lpe->doOnApply(this); + lpe->doOnApply_impl(this); // indicate that all necessary preparations are done and the effect can be performed lpe->setReady(); -- cgit v1.2.3 From 6f508cfcaa161695711309d3413b90d2b3f44ea0 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Mon, 14 Apr 2014 21:50:06 -0400 Subject: Minor things (bzr r13090.1.58) --- src/sp-lpe-item.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/sp-lpe-item.cpp') diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index 07fa6147b..ae5763e67 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -689,12 +689,20 @@ static std::string hreflist_write_svg(HRefList const & list) // Return a copy of the effect list PathEffectList SPLPEItem::getEffectList() { + if (!path_effect_list) { + g_critical("Broken path effect list in %s\n", __FILE__); + return PathEffectList(); + } return *path_effect_list; } // Return a copy of the effect list PathEffectList const SPLPEItem::getEffectList() const { + if (!path_effect_list) { + g_critical("Broken path effect list in %s\n", __FILE__); + return PathEffectList(); + } return *path_effect_list; } -- cgit v1.2.3 From 2a5ab3d65249a8a7dde08097c87562d5bca598f2 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Tue, 29 Apr 2014 19:55:14 -0400 Subject: Fix a small issue with Attach Path (bzr r13090.1.69) --- src/sp-lpe-item.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/sp-lpe-item.cpp') diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index b5dd74fc6..19a688ca5 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -242,7 +242,7 @@ bool SPLPEItem::performPathEffect(SPCurve *curve) { // Groups have their doBeforeEffect called elsewhere if (!SP_IS_GROUP(this)) { - lpe->doBeforeEffect(this); + lpe->doBeforeEffect_impl(this); } try { @@ -256,6 +256,9 @@ bool SPLPEItem::performPathEffect(SPCurve *curve) { } return false; } + if (!SP_IS_GROUP(this)) { + lpe->doAfterEffect(this); + } } } } -- cgit v1.2.3