diff options
| author | root <root@jtx.marker.es> | 2013-03-22 00:50:18 +0000 |
|---|---|---|
| committer | root <root@jtx.marker.es> | 2013-03-22 00:50:18 +0000 |
| commit | d142ebe8740c40922c1a6aa423ca4e0e7d2335d6 (patch) | |
| tree | a16c044c69201a1debd9fbc6cedc76f168f4ca0a /src | |
| parent | Fixing errors at delete extrewmiuns nodes (diff) | |
| download | inkscape-d142ebe8740c40922c1a6aa423ca4e0e7d2335d6.tar.gz inkscape-d142ebe8740c40922c1a6aa423ca4e0e7d2335d6.zip | |
Fixed end extremium node delete fault, ready for testing
(bzr r11950.1.66)
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/lpe-bspline.h | 1 | ||||
| -rw-r--r-- | src/ui/tool/path-manipulator.cpp | 36 | ||||
| -rw-r--r-- | src/ui/tool/path-manipulator.h | 6 | ||||
| -rw-r--r-- | src/widgets/toolbox.cpp | 6 |
4 files changed, 32 insertions, 17 deletions
diff --git a/src/live_effects/lpe-bspline.h b/src/live_effects/lpe-bspline.h index 44c3f451c..20012f894 100644 --- a/src/live_effects/lpe-bspline.h +++ b/src/live_effects/lpe-bspline.h @@ -38,6 +38,7 @@ public: ScalarParam steps; private: + BoolParam ignoreCusp; ScalarParam weight; diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index 571e6dd7a..8f6651dee 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -9,9 +9,7 @@ * Copyright (C) 2009 Authors * Released under GNU GPL, read the file 'COPYING' for more information */ -//BSpline -#include "live_effects/lpe-bspline.h" -//BSpline end + #include "live_effects/lpe-powerstroke.h" #include <string> #include <sstream> @@ -46,6 +44,9 @@ #include "ui/tool/multi-path-manipulator.h" #include "xml/node.h" #include "xml/node-observer.h" +//BSpline +#include "live_effects/lpe-bspline.h" +//BSpline end namespace Inkscape { namespace UI { @@ -149,8 +150,8 @@ PathManipulator::PathManipulator(MultiPathManipulator &mpm, SPPath *path, sigc::hide( sigc::mem_fun(*this, &PathManipulator::_updateOutlineOnZoomChange))); _createControlPointsFromGeometry(); - - LivePathEffect::LPEBSpline *lpe_bsp = NULL; + //BSpline + lpe_bsp = NULL; if (SP_LPE_ITEM(_path) && sp_lpe_item_has_path_effect(SP_LPE_ITEM(_path))){ Inkscape::LivePathEffect::Effect* thisEffect = sp_lpe_item_has_path_effect_of_type(SP_LPE_ITEM(_path),Inkscape::LivePathEffect::BSPLINE); if(thisEffect){ @@ -162,6 +163,7 @@ PathManipulator::PathManipulator(MultiPathManipulator &mpm, SPPath *path, isBSpline = true; controlBSplineSteps = lpe_bsp->steps+1; } + //BSpline End } PathManipulator::~PathManipulator() @@ -676,8 +678,15 @@ unsigned PathManipulator::_deleteStretch(NodeList::iterator start, NodeList::ite } //BSpline if(isBSpline){ - start.prev()->front()->setPosition(BSplineHandleReposition(start.prev()->front())); - end->back()->setPosition(BSplineHandleReposition(end->back())); + double pos = 0; + if(start.prev()){ + pos = BSplineHandlePosition(start.prev()->back()); + start.prev()->front()->setPosition(BSplineHandleReposition(start.prev()->front(),pos)); + } + if(end){ + pos = BSplineHandlePosition(end->front()); + end->back()->setPosition(BSplineHandleReposition(end->back(),pos)); + } } //BSpline End @@ -1192,16 +1201,19 @@ void PathManipulator::_createControlPointsFromGeometry() } double PathManipulator::BSplineHandlePosition(Handle *h){ + //BSpline + if(lpe_bsp){ + controlBSplineSteps = lpe_bsp->steps+1; + } + //BSpline End using Geom::X; using Geom::Y; double pos = 0; Node *n = h->parent(); SPCurve *lineInsideNodes = new SPCurve(); Node * nextNode = NULL; - try{ + if(!n->isEndNode()) nextNode = n->nodeToward(h); - }catch( char * str ) { - } if(nextNode){ Geom::Point positionH = h->position(); positionH = Geom::Point(positionH[X] - 0.0625,positionH[Y] - 0.0625); @@ -1227,10 +1239,8 @@ Geom::Point PathManipulator::BSplineHandleReposition(Handle *h,double pos){ Geom::D2< Geom::SBasis > SBasisInsideNodes; SPCurve *lineInsideNodes = new SPCurve(); Node * nextNode = NULL; - try{ + if(!n->isEndNode()) nextNode = n->nodeToward(h); - }catch( char * str ) { - } if(nextNode && pos != 0){ lineInsideNodes->moveto(n->position()); lineInsideNodes->lineto(nextNode->position()); diff --git a/src/ui/tool/path-manipulator.h b/src/ui/tool/path-manipulator.h index 948d4544b..496bd957c 100644 --- a/src/ui/tool/path-manipulator.h +++ b/src/ui/tool/path-manipulator.h @@ -19,6 +19,9 @@ #include <boost/weak_ptr.hpp> #include "ui/tool/node.h" #include "ui/tool/manipulator.h" +//BSpline +#include "live_effects/lpe-bspline.h" +//BSpline end struct SPCanvasItem; class SPCurve; @@ -96,6 +99,7 @@ public: bool search_unselected, bool closest); //BSpline bool isBSpline; + int controlBSplineSteps; //BSpline End // this is necessary for Tab-selection in MultiPathManipulator SubpathList &subpathList() { return _subpaths; } @@ -107,7 +111,7 @@ private: void _createControlPointsFromGeometry(); //BSpline - int controlBSplineSteps; + LivePathEffect::LPEBSpline *lpe_bsp; double BSplineHandlePosition(Handle *h); Geom::Point BSplineHandleReposition(Handle *h); Geom::Point BSplineHandleReposition(Handle *h,double pos); diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 3a7eb6b9c..99978c019 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -514,9 +514,9 @@ static gchar const * ui_descr = " <toolitem action='MeshRowAction' />" " <toolitem action='MeshColumnAction' />" " <separator />" -// " <toolitem action='MeshEditFillAction' />" -// " <toolitem action='MeshEditStrokeAction' />" -// " <toolitem action='MeshShowHandlesAction' />" + " <toolitem action='MeshEditFillAction' />" + " <toolitem action='MeshEditStrokeAction' />" + " <toolitem action='MeshShowHandlesAction' />" " <separator />" " </toolbar>" |
