From 5ad260d5810f6f8bb2cdea7186d0766091ad9b54 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sat, 11 Jun 2016 17:32:56 +0200 Subject: Fixing satellites bug on erase (bzr r13645.1.146) --- src/live_effects/parameter/satellitesarray.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/live_effects/parameter/satellitesarray.cpp') diff --git a/src/live_effects/parameter/satellitesarray.cpp b/src/live_effects/parameter/satellitesarray.cpp index 45a6282e0..cb7d0df8f 100644 --- a/src/live_effects/parameter/satellitesarray.cpp +++ b/src/live_effects/parameter/satellitesarray.cpp @@ -44,11 +44,16 @@ void SatellitesArrayParam::set_oncanvas_looks(SPKnotShapeType shape, _knot_color = color; } -void SatellitesArrayParam::setPathVectorSatellites(PathVectorSatellites pathVectorSatellites) +void SatellitesArrayParam::setPathVectorSatellites(PathVectorSatellites pathVectorSatellites, bool refresh_knots) { + if (refresh_knots) { + clearKnotHolder(knoth); + } _last_pathVectorSatellites = pathVectorSatellites; param_set_and_write_new_value(_last_pathVectorSatellites.getSatellites()); - + if (refresh_knots) { + addKnotHolderEntities(knoth, SP_ACTIVE_DESKTOP, knoth.getItem()); + } } void SatellitesArrayParam::setUseDistance(bool use_knot_distance) @@ -214,6 +219,16 @@ void SatellitesArrayParam::param_transform_multiply(Geom::Affine const &postmul, } } +void SatellitesArrayParam::clearKnotHolder(KnotHolder *knotholder) +{ + for (std::list::iterator i = knotholder.entity.begin(); i != knotholder.entity.end(); ++i) + { + delete (*i); + (*i) = NULL; + } + entity.clear(); // is this necessary? +} + void SatellitesArrayParam::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item, bool mirror) -- cgit v1.2.3