summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2016-06-11 15:32:56 +0000
committerjabiertxof <info@marker.es>2016-06-11 15:32:56 +0000
commit5ad260d5810f6f8bb2cdea7186d0766091ad9b54 (patch)
tree863aa5e6139a22b09a7dea8bb41f4a81a35d5694 /src
parentRename branch (diff)
downloadinkscape-5ad260d5810f6f8bb2cdea7186d0766091ad9b54.tar.gz
inkscape-5ad260d5810f6f8bb2cdea7186d0766091ad9b54.zip
Fixing satellites bug on erase
(bzr r13645.1.146)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/lpe-fillet-chamfer.cpp3
-rw-r--r--src/live_effects/parameter/satellitesarray.cpp19
-rw-r--r--src/live_effects/parameter/satellitesarray.h3
3 files changed, 20 insertions, 5 deletions
diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp
index 56f7557ba..b4eca6909 100644
--- a/src/live_effects/lpe-fillet-chamfer.cpp
+++ b/src/live_effects/lpe-fillet-chamfer.cpp
@@ -378,8 +378,7 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem)
satellite.setHasMirror(mirror_knots);
satellite.setHidden(hide_knots);
pathVectorSatellites.recalculateForNewPathVector(pathv, satellite);
- satellites_param.setPathVectorSatellites(pathVectorSatellites);
- refreshKnots();
+ satellites_param.setPathVectorSatellites(pathVectorSatellites, true);
return;
}
Satellites satellites = satellites_param.data();
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<KnotHolderEntity *>::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)
diff --git a/src/live_effects/parameter/satellitesarray.h b/src/live_effects/parameter/satellitesarray.h
index 27e9dea6f..c52d28541 100644
--- a/src/live_effects/parameter/satellitesarray.h
+++ b/src/live_effects/parameter/satellitesarray.h
@@ -45,6 +45,7 @@ public:
SPItem *item);
virtual void addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop,
SPItem *item, bool mirror);
+ virtual void clearKnotHolder(KnotHolder *knotholder);
virtual void addCanvasIndicators(SPLPEItem const *lpeitem,
std::vector<Geom::PathVector> &hp_vec);
virtual void updateCanvasIndicators();
@@ -56,7 +57,7 @@ public:
void param_transform_multiply(Geom::Affine const &postmul, bool /*set*/);
void setUseDistance(bool use_knot_distance);
void setEffectType(EffectType et);
- void setPathVectorSatellites(PathVectorSatellites pathVectorSatellites);
+ void setPathVectorSatellites(PathVectorSatellites pathVectorSatellites, bool refresh_knots = false);
bool validData(size_t index, size_t subindex);
void set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color);