From aeffc3f474c1ce460b2c9f8340de283d5853a164 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Thu, 19 Mar 2015 19:26:22 +0100 Subject: fixing a boring bug in path manipulator (bzr r13645.1.43) --- src/ui/tool/path-manipulator.cpp | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to 'src/ui/tool/path-manipulator.cpp') diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index c8b986824..dbcde240a 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -1221,10 +1221,13 @@ int PathManipulator::BSplineGetSteps() const { LivePathEffect::LPEBSpline const *lpe_bsp = NULL; - if (SP_IS_LPE_ITEM(_path) && _path->hasPathEffect()){ - Inkscape::LivePathEffect::Effect const *thisEffect = SP_LPE_ITEM(_path)->getPathEffectOfType(Inkscape::LivePathEffect::BSPLINE); - if(thisEffect){ - lpe_bsp = dynamic_cast(thisEffect->getLPEObj()->get_lpe()); + SPLPEItem * path = dynamic_cast(_path); + if (path){ + if(path->hasPathEffect()){ + Inkscape::LivePathEffect::Effect const *thisEffect = path->getPathEffectOfType(Inkscape::LivePathEffect::BSPLINE); + if(thisEffect){ + lpe_bsp = dynamic_cast(thisEffect->getLPEObj()->get_lpe()); + } } } int steps = 0; @@ -1338,19 +1341,22 @@ void PathManipulator::_createGeometryFromControlPoints(bool alert_LPE) _spcurve->set_pathvector(pathv); if (alert_LPE) { /// \todo note that _path can be an Inkscape::LivePathEffect::Effect* too, kind of confusing, rework member naming? - if (SP_IS_LPE_ITEM(_path) && _path->hasPathEffect()){ - Inkscape::LivePathEffect::Effect* thisEffect = SP_LPE_ITEM(_path)->getPathEffectOfType(Inkscape::LivePathEffect::POWERSTROKE); - if(thisEffect){ - LivePathEffect::LPEPowerStroke *lpe_pwr = dynamic_cast(thisEffect->getLPEObj()->get_lpe()); - if (lpe_pwr) { - lpe_pwr->adjustForNewPath(pathv); + SPLPEItem * path = dynamic_cast(_path); + if (path){ + if(path->hasPathEffect()){ + Inkscape::LivePathEffect::Effect* thisEffect = path->getPathEffectOfType(Inkscape::LivePathEffect::POWERSTROKE); + if(thisEffect){ + LivePathEffect::LPEPowerStroke *lpe_pwr = dynamic_cast(thisEffect->getLPEObj()->get_lpe()); + if (lpe_pwr) { + lpe_pwr->adjustForNewPath(pathv); + } } - } - thisEffect = SP_LPE_ITEM(_path)->getPathEffectOfType(Inkscape::LivePathEffect::FILLET_CHAMFER); - if(thisEffect){ - LivePathEffect::LPEFilletChamfer *lpe_fll = dynamic_cast(thisEffect->getLPEObj()->get_lpe()); - if (lpe_fll) { - lpe_fll->adjustForNewPath(pathv); + thisEffect = path->getPathEffectOfType(Inkscape::LivePathEffect::FILLET_CHAMFER); + if(thisEffect){ + LivePathEffect::LPEFilletChamfer *lpe_fll = dynamic_cast(thisEffect->getLPEObj()->get_lpe()); + if (lpe_fll) { + lpe_fll->adjustForNewPath(pathv); + } } } } -- cgit v1.2.3 From cfe5bd077cc29fd43385792435f687d468aca13f Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sat, 21 Mar 2015 10:55:27 +0100 Subject: fix bspline calls and atemp to fic a bug whith map (bzr r13645.1.46) --- src/ui/tool/path-manipulator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ui/tool/path-manipulator.cpp') diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index dbcde240a..64eba3921 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -670,7 +670,7 @@ unsigned PathManipulator::_deleteStretch(NodeList::iterator start, NodeList::ite start = next; } // if we are removing, we readjust the handlers - if(isBSpline()){ + if(isBSpline(false)){ if(start.prev()){ start.prev()->front()->setPosition(BSplineHandleReposition(start.prev()->front(),start.prev()->back())); } @@ -999,7 +999,7 @@ NodeList::iterator PathManipulator::subdivideSegment(NodeList::iterator first, d // set new handle positions Node *n = new Node(_multi_path_manipulator._path_data.node_data, seg2[0]); - if(!isBSpline()){ + if(!isBSpline(false)){ n->back()->setPosition(seg1[2]); n->front()->setPosition(seg2[1]); n->setType(NODE_SMOOTH, false); @@ -1245,7 +1245,7 @@ bool PathManipulator::isBSpline(bool recalculate){ return _is_bspline; } -bool PathManipulator::isBSpline() const { +bool PathManipulator::isBSpline(false) const { return BSplineGetSteps() > 0; } -- cgit v1.2.3 From c1487f9dc277520b8734b7e80387b35c78d979ae Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sat, 21 Mar 2015 22:24:37 +0100 Subject: Fixed bug whith maps (bzr r13645.1.49) --- src/ui/tool/path-manipulator.cpp | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'src/ui/tool/path-manipulator.cpp') diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index 8b735f3e6..00e18dd3f 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -11,6 +11,7 @@ */ #include "live_effects/lpe-powerstroke.h" +#include "live_effects/lpe-bspline.h" #include "live_effects/lpe-fillet-chamfer.h" #include #include @@ -20,7 +21,7 @@ #include <2geom/bezier-curve.h> #include <2geom/bezier-utils.h> #include <2geom/path-sink.h> -#include + #include "ui/tool/path-manipulator.h" #include "desktop.h" @@ -33,6 +34,7 @@ #include "live_effects/lpeobject.h" #include "live_effects/lpeobject-reference.h" #include "live_effects/parameter/path.h" + #include "sp-path.h" #include "helper/geom.h" #include "preferences.h" @@ -43,7 +45,7 @@ #include "ui/tool/multi-path-manipulator.h" #include "xml/node.h" #include "xml/node-observer.h" -#include "live_effects/lpe-bspline.h" +#include namespace Inkscape { namespace UI { @@ -151,7 +153,7 @@ PathManipulator::PathManipulator(MultiPathManipulator &mpm, SPPath *path, _createControlPointsFromGeometry(); //Define if the path is BSpline on construction - isBSpline(true); + recalculateIsBSpline(); } PathManipulator::~PathManipulator() @@ -1238,22 +1240,18 @@ int PathManipulator::BSplineGetSteps() const { } // determines if the trace has bspline effect -bool PathManipulator::isBSpline(bool recalculate){ - if(recalculate){ - SPLPEItem * path = dynamic_cast(_path); - if (path){ - if(path->hasPathEffect()){ - Inkscape::LivePathEffect::Effect const *thisEffect = path->getPathEffectOfType(Inkscape::LivePathEffect::BSPLINE); - if(thisEffect){ - _is_bspline = true; - return _is_bspline; - } +void PathManipulator::recalculateIsBSpline(){ + SPLPEItem * path = dynamic_cast(_path); + if (path){ + if(path->hasPathEffect()){ + Inkscape::LivePathEffect::Effect const *thisEffect = path->getPathEffectOfType(Inkscape::LivePathEffect::BSPLINE); + if(thisEffect){ + _is_bspline = true; + return; } } - } _is_bspline = false; - return _is_bspline; } bool PathManipulator::isBSpline() const { @@ -1325,7 +1323,7 @@ void PathManipulator::_createGeometryFromControlPoints(bool alert_LPE) { Geom::PathBuilder builder; //Refresh if is bspline some times -think on path change selection, this value get lost - isBSpline(true); + recalculateIsBSpline(); for (std::list::iterator spi = _subpaths.begin(); spi != _subpaths.end(); ) { SubpathPtr subpath = *spi; if (subpath->empty()) { -- cgit v1.2.3 From edc48d93d2b528c20b9adb0f7d074c73c46f03eb Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Fri, 27 Mar 2015 00:01:44 +0100 Subject: adding append mode (bzr r13645.1.54) --- src/ui/tool/path-manipulator.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/ui/tool/path-manipulator.cpp') diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index d2bdd9384..ccf75dcde 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -34,7 +34,6 @@ #include "live_effects/lpeobject.h" #include "live_effects/lpeobject-reference.h" #include "live_effects/parameter/path.h" - #include "sp-path.h" #include "helper/geom.h" #include "preferences.h" -- cgit v1.2.3 From 04218b26ae0a10bf9e64721fb0dd789f024afca5 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Fri, 3 Apr 2015 16:10:46 +0200 Subject: Update pathinfo class to allow piecewise and pathvector as input. Add a method on pointwise to allow update if degenerated curves in new path, not noticed by piecewises (bzr r13645.1.72) --- src/ui/tool/path-manipulator.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/ui/tool/path-manipulator.cpp') diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index dbae69f2c..d50c3057b 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -1356,13 +1356,6 @@ void PathManipulator::_createGeometryFromControlPoints(bool alert_LPE) lpe_pwr->adjustForNewPath(pathv); } } - thisEffect = _path->getPathEffectOfType(Inkscape::LivePathEffect::FILLET_CHAMFER); - if(thisEffect){ - LivePathEffect::LPEFilletChamfer *lpe_fll = dynamic_cast(thisEffect->getLPEObj()->get_lpe()); - if (lpe_fll) { - lpe_fll->adjustForNewPath(pathv); - } - } } } -- cgit v1.2.3 From 8d35486a82d04a28dc9f297147ad4666b34cde4a Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Thu, 26 May 2016 19:37:15 +0200 Subject: Fixing pointwise (bzr r13645.1.143) --- src/ui/tool/path-manipulator.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/ui/tool/path-manipulator.cpp') diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index 9d479432b..0d603ad1f 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -12,7 +12,6 @@ #include "live_effects/lpe-powerstroke.h" #include "live_effects/lpe-bspline.h" -#include "live_effects/lpe-fillet-chamfer.h" #include #include #include -- cgit v1.2.3