From 1f0a20e9f4270de3aff4b9ce0484e1d26c6d58da Mon Sep 17 00:00:00 2001 From: Jabiertxo Arraiza Cenoz Date: Fri, 8 Sep 2017 22:28:13 +0200 Subject: Fix for bug: 1715433 :: Clone original LPE can no longer be used to fill a powerstroke path --- src/live_effects/parameter/originalpatharray.cpp | 28 +++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'src/live_effects/parameter/originalpatharray.cpp') diff --git a/src/live_effects/parameter/originalpatharray.cpp b/src/live_effects/parameter/originalpatharray.cpp index 92859de05..2513a0d5e 100644 --- a/src/live_effects/parameter/originalpatharray.cpp +++ b/src/live_effects/parameter/originalpatharray.cpp @@ -9,6 +9,10 @@ #endif #include "live_effects/parameter/originalpatharray.h" +#include "live_effects/lpe-spiro.h" +#include "live_effects/lpe-bspline.h" +#include "live_effects/lpeobject.h" +#include "live_effects/lpeobject-reference.h" #include #include @@ -100,6 +104,8 @@ OriginalPathArrayParam::OriginalPathArrayParam( const Glib::ustring& label, //_scroller.set_shadow_type(Gtk::SHADOW_IN); oncanvas_editable = true; + _from_original_d = false; + _allow_only_bspline_spiro = false; } @@ -389,7 +395,27 @@ void OriginalPathArrayParam::setPathVector(SPObject *linked_obj, guint /*flags*/ } SPCurve *curve = NULL; if (SP_IS_SHAPE(linked_obj)) { - curve = SP_SHAPE(linked_obj)->getCurve(); + SPLPEItem * lpe_item = SP_LPE_ITEM(linked_obj); + if (_from_original_d) { + curve = SP_SHAPE(linked_obj)->getCurveBeforeLPE(); + } else if (_allow_only_bspline_spiro && lpe_item && lpe_item->hasPathEffect()){ + curve = SP_SHAPE(linked_obj)->getCurveBeforeLPE(); + PathEffectList lpelist = lpe_item->getEffectList(); + PathEffectList::iterator i; + for (i = lpelist.begin(); i != lpelist.end(); ++i) { + LivePathEffectObject *lpeobj = (*i)->lpeobject; + if (lpeobj) { + Inkscape::LivePathEffect::Effect *lpe = lpeobj->get_lpe(); + if (dynamic_cast(lpe)) { + LivePathEffect::sp_bspline_do_effect(curve, 0); + } else if (dynamic_cast(lpe)) { + LivePathEffect::sp_spiro_do_effect(curve); + } + } + } + } else { + curve = SP_SHAPE(linked_obj)->getCurve(); + } } if (SP_IS_TEXT(linked_obj)) { curve = SP_TEXT(linked_obj)->getNormalizedBpath(); -- cgit v1.2.3