summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-03-16 23:57:12 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-03-16 23:57:12 +0000
commitacc3de4356672491bcdd795fbac6b80ee2faf27d (patch)
treee97486711341e195c612ab0adfc5ef3e244087e9 /src
parentsimplify the code in isBSpline (diff)
downloadinkscape-acc3de4356672491bcdd795fbac6b80ee2faf27d.tar.gz
inkscape-acc3de4356672491bcdd795fbac6b80ee2faf27d.zip
Fix to solve static var in isBSpline function
(bzr r11950.1.298)
Diffstat (limited to 'src')
-rw-r--r--src/ui/tool/path-manipulator.cpp21
-rw-r--r--src/ui/tool/path-manipulator.h3
2 files changed, 12 insertions, 12 deletions
diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp
index 3e54acddf..841ab659a 100644
--- a/src/ui/tool/path-manipulator.cpp
+++ b/src/ui/tool/path-manipulator.cpp
@@ -145,7 +145,8 @@ PathManipulator::PathManipulator(MultiPathManipulator &mpm, SPPath *path,
sigc::hide( sigc::mem_fun(*this, &PathManipulator::_updateOutlineOnZoomChange)));
_createControlPointsFromGeometry();
- isBSpline(/*true*/);
+ //Define if the path is BSpline on construction
+ isBSpline(true);
}
PathManipulator::~PathManipulator()
@@ -664,7 +665,7 @@ unsigned PathManipulator::_deleteStretch(NodeList::iterator start, NodeList::ite
start = next;
}
// if we are removing, we readjust the handlers
- if(isBSpline(false)){
+ if(isBSpline()){
double pos = 0.0000;
if(start.prev()){
pos = BSplineHandlePosition(start.prev()->back());
@@ -1201,14 +1202,11 @@ int PathManipulator::BSplineGetSteps(){
}
// determines if the trace has bspline effect
-bool PathManipulator::isBSpline(/*bool recalculate*/){
- // Taking out the static dont need this part
- // static int BSplineSteps = this->BSplineGetSteps();
- //if(recalculate){
- // BSplineSteps = this->BSplineGetSteps();
- //}
- //return BSplineSteps > 0;
- return this->BSplineGetSteps() > 0;
+bool PathManipulator::isBSpline(bool recalculate){
+ if(recalculate){
+ _is_bspline = this->BSplineGetSteps() > 0;
+ }
+ return _is_bspline;
}
// returns the corresponding strength to the position of a handler
@@ -1284,7 +1282,8 @@ void PathManipulator::BSplineNodeHandlesReposition(Node *n){
void PathManipulator::_createGeometryFromControlPoints(bool alert_LPE)
{
Geom::PathBuilder builder;
- isBSpline(/*true*/);
+ //Refresh if is bspline some times -think on path change selection, this value get lost
+ isBSpline(true);
for (std::list<SubpathPtr>::iterator spi = _subpaths.begin(); spi != _subpaths.end(); ) {
SubpathPtr subpath = *spi;
if (subpath->empty()) {
diff --git a/src/ui/tool/path-manipulator.h b/src/ui/tool/path-manipulator.h
index 67590832d..f15533021 100644
--- a/src/ui/tool/path-manipulator.h
+++ b/src/ui/tool/path-manipulator.h
@@ -106,7 +106,7 @@ private:
typedef boost::shared_ptr<NodeList> SubpathPtr;
void _createControlPointsFromGeometry();
- bool isBSpline(/*bool recalculate = true*/);
+ bool isBSpline(bool recalculate = true);
double BSplineHandlePosition(Handle *h);
Geom::Point BSplineHandleReposition(Handle *h);
Geom::Point BSplineHandleReposition(Handle *h,double pos);
@@ -152,6 +152,7 @@ private:
bool _show_path_direction;
bool _live_outline;
bool _live_objects;
+ bool _is_bspline;
Glib::ustring _lpe_key;
friend class PathManipulatorObserver;