summaryrefslogtreecommitdiffstats
path: root/src/live_effects
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-04-02 23:46:44 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-04-02 23:46:44 +0000
commit323fc5ae45fd8374de4561d0771f6b9d5cd3e87a (patch)
treeb79bfbdf24df455572eed37aa5afc27b8dac4b1e /src/live_effects
parentadd move knots when move nodes pointed by su_v (diff)
downloadinkscape-323fc5ae45fd8374de4561d0771f6b9d5cd3e87a.tar.gz
inkscape-323fc5ae45fd8374de4561d0771f6b9d5cd3e87a.zip
Adding suport for duplicate nodes
Allow degenrate curves Show helper path whith original path (bzr r13645.1.70)
Diffstat (limited to 'src/live_effects')
-rw-r--r--src/live_effects/lpe-fillet-chamfer.cpp28
-rw-r--r--src/live_effects/lpe-fillet-chamfer.h3
2 files changed, 21 insertions, 10 deletions
diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp
index ac412e120..f7fd6f64b 100644
--- a/src/live_effects/lpe-fillet-chamfer.cpp
+++ b/src/live_effects/lpe-fillet-chamfer.cpp
@@ -129,12 +129,6 @@ void LPEFilletChamfer::doOnApply(SPLPEItem const *lpeItem)
int counter = 0;
size_t steps = chamfer_steps;
while (curve_it1 != curve_endit) {
- if ((*curve_it1).isDegenerate() || (*curve_it1).isDegenerate()) {
- g_warning("LPE Fillet not handle degenerate curves.");
- SPLPEItem *item = const_cast<SPLPEItem *>(lpeItem);
- item->removeCurrentPathEffect(false);
- return;
- }
bool active = true;
bool hidden = false;
if (counter == 0) {
@@ -380,6 +374,9 @@ void LPEFilletChamfer::updateSatelliteType(Geom::SatelliteType satellitetype)
void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem)
{
+ if(!_hp.empty()){
+ _hp.clear();
+ }
SPLPEItem *splpeitem = const_cast<SPLPEItem *>(lpeItem);
SPShape *shape = dynamic_cast<SPShape *>(splpeitem);
if (shape) {
@@ -469,6 +466,12 @@ LPEFilletChamfer::adjustForNewPath(std::vector<Geom::Path> const &path_in)
}
}
+void
+LPEFilletChamfer::addCanvasIndicators(SPLPEItem const */*lpeitem*/, std::vector<Geom::PathVector> &hp_vec)
+{
+ hp_vec.push_back(_hp);
+}
+
std::vector<Geom::Path>
LPEFilletChamfer::doEffect_path(std::vector<Geom::Path> const &path_in)
{
@@ -483,6 +486,7 @@ LPEFilletChamfer::doEffect_path(std::vector<Geom::Path> const &path_in)
if (path_it->empty()) {
continue;
}
+ _hp.push_back(*path_it);
Geom::Path tmp_path;
Geom::Path::const_iterator curve_it1 = path_it->begin();
Geom::Path::const_iterator curve_it2 = ++(path_it->begin());
@@ -511,9 +515,15 @@ LPEFilletChamfer::doEffect_path(std::vector<Geom::Path> const &path_in)
double time0 = 0;
std::vector<Geom::Satellite> sats = pointwise->getSatellites();
while (curve_it1 != curve_endit) {
- if ((*curve_it1).isDegenerate() || (*curve_it1).isDegenerate()) {
- g_warning("LPE Fillet not handle degenerate curves.");
- return path_in;
+ if ((*curve_it1).isDegenerate() || (curve_it2 != curve_endit && (*curve_it2).isDegenerate())) {
+ ++curve_it1;
+ if (curve_it2 != curve_endit) {
+ ++curve_it2;
+ }
+ counter++;
+ counter_curves++;
+ time0 = 0.0;
+ continue;
}
Satellite satellite;
Curve *curve_it2_fixed = path_it->begin()->duplicate();
diff --git a/src/live_effects/lpe-fillet-chamfer.h b/src/live_effects/lpe-fillet-chamfer.h
index dc2199609..e3ea41ba8 100644
--- a/src/live_effects/lpe-fillet-chamfer.h
+++ b/src/live_effects/lpe-fillet-chamfer.h
@@ -42,7 +42,7 @@ public:
virtual void doOnApply(SPLPEItem const *lpeItem);
virtual void adjustForNewPath(std::vector<Geom::Path> const &path_in);
virtual Gtk::Widget *newWidget();
-
+ void addCanvasIndicators(SPLPEItem const */*lpeitem*/, std::vector<Geom::PathVector> &hp_vec);
void updateSatelliteType(Geom::SatelliteType satellitetype);
void updateChamferSteps();
void updateAmount();
@@ -69,6 +69,7 @@ private:
Geom::Pointwise *pointwise;
double segment_size;
+ Geom::PathVector _hp;
LPEFilletChamfer(const LPEFilletChamfer &);
LPEFilletChamfer &operator=(const LPEFilletChamfer &);