diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2013-05-16 22:53:42 +0000 |
|---|---|---|
| committer | Jabiertxo Arraiza Zenotz <jtx@jtx.marker.es> | 2013-05-16 22:53:42 +0000 |
| commit | e17c04bd7386e2e346b7f4f760f6e6ba3c24b886 (patch) | |
| tree | 73cee2b4e82e7cee5626aeceed3c8851aa4147b9 /src | |
| parent | Update to trunk (diff) | |
| download | inkscape-e17c04bd7386e2e346b7f4f760f6e6ba3c24b886.tar.gz inkscape-e17c04bd7386e2e346b7f4f760f6e6ba3c24b886.zip | |
Fix error with try-catch
(bzr r11950.1.115)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/tool/node.cpp | 61 | ||||
| -rw-r--r-- | src/ui/tool/path-manipulator.cpp | 2 | ||||
| -rw-r--r-- | src/ui/tool/path-manipulator.h | 2 |
3 files changed, 51 insertions, 14 deletions
diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index 5362a6c45..89a0f4163 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -175,10 +175,25 @@ void Handle::move(Geom::Point const &new_pos) //BSpline if(_pm().isBSpline){ h = this; + setPosition(_pm().BSplineHandleReposition(h)); _parent->bsplineWeight = _pm().BSplineHandlePosition(h); - setPosition(_pm().BSplineHandleReposition(h,_parent->bsplineWeight)); - h2 = this->other(); - this->other()->setPosition(_pm().BSplineHandleReposition(h2,_parent->bsplineWeight)); + typedef ControlPointSelection::Set Set; + Set &nodes = _parent->_selection.allPoints(); + for (Set::iterator i = nodes.begin(); i != nodes.end(); ++i) { + if((*i)->selected()){ + Node *n = static_cast<Node*>(*i); + h = n->front(); + h2 = n->back(); + h->setPosition(_pm().BSplineHandleReposition(h,_parent->bsplineWeight)); + h2->setPosition(_pm().BSplineHandleReposition(h2,_parent->bsplineWeight)); + } + } + if(!_parent->selected()){ + h = _parent->front(); + h2 = _parent->back(); + h->setPosition(_pm().BSplineHandleReposition(h,_parent->bsplineWeight)); + h2->setPosition(_pm().BSplineHandleReposition(h2,_parent->bsplineWeight)); + } } //BSpline End return; @@ -192,6 +207,30 @@ void Handle::move(Geom::Point const &new_pos) Geom::Point new_delta = (Geom::dot(delta, direction) / Geom::L2sq(direction)) * direction; setRelativePos(new_delta); + //BSpline + if(_pm().isBSpline){ + h = this; + setPosition(_pm().BSplineHandleReposition(h)); + _parent->bsplineWeight = _pm().BSplineHandlePosition(h); + typedef ControlPointSelection::Set Set; + Set &nodes = _parent->_selection.allPoints(); + for (Set::iterator i = nodes.begin(); i != nodes.end(); ++i) { + if((*i)->selected()){ + Node *n = static_cast<Node*>(*i); + h = n->front(); + h2 = n->back(); + h->setPosition(_pm().BSplineHandleReposition(h,_parent->bsplineWeight)); + h2->setPosition(_pm().BSplineHandleReposition(h2,_parent->bsplineWeight)); + } + } + if(!_parent->selected()){ + h = _parent->front(); + h2 = _parent->back(); + h->setPosition(_pm().BSplineHandleReposition(h,_parent->bsplineWeight)); + h2->setPosition(_pm().BSplineHandleReposition(h2,_parent->bsplineWeight)); + } + } + //BSpline End return; } @@ -227,6 +266,12 @@ void Handle::move(Geom::Point const &new_pos) h2->setPosition(_pm().BSplineHandleReposition(h2,_parent->bsplineWeight)); } } + if(!_parent->selected()){ + h = _parent->front(); + h2 = _parent->back(); + h->setPosition(_pm().BSplineHandleReposition(h,_parent->bsplineWeight)); + h2->setPosition(_pm().BSplineHandleReposition(h2,_parent->bsplineWeight)); + } } //BSpline End } @@ -779,14 +824,6 @@ void Node::setType(NodeType type, bool update_handles) updateState(); // The size of the control might have changed return; } - //BSpline - bool isBSpline = false; - try { - isBSpline = nodeList().subpathList().pm().isBSpline; - } - catch( char * str ) { - } - //BSpline End // if update_handles is true, adjust handle positions to match the node type // handle degenerate handles appropriately if (update_handles) { @@ -870,7 +907,7 @@ void Node::setType(NodeType type, bool update_handles) default: break; } //BSpline - if(isBSpline){ + if(_pm().isBSpline){ Handle* front = &_front; Handle* back = &_back; this->bsplineWeight = _pm().BSplineHandlePosition(front); diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index cad794860..7785dd685 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -110,6 +110,7 @@ void build_segment(Geom::PathBuilder &, Node *, Node *); PathManipulator::PathManipulator(MultiPathManipulator &mpm, SPPath *path, Geom::Affine const &et, guint32 outline_color, Glib::ustring lpe_key) : PointManipulator(mpm._path_data.node_data.desktop, *mpm._path_data.node_data.selection) + , isBSpline(true) , _subpaths(*this) , _multi_path_manipulator(mpm) , _path(path) @@ -157,7 +158,6 @@ PathManipulator::PathManipulator(MultiPathManipulator &mpm, SPPath *path, lpe_bsp = dynamic_cast<LivePathEffect::LPEBSpline*>(thisEffect->getLPEObj()->get_lpe()); } } - isBSpline = false; if(lpe_bsp){ isBSpline = true; } diff --git a/src/ui/tool/path-manipulator.h b/src/ui/tool/path-manipulator.h index 743d70b96..2fc0b90da 100644 --- a/src/ui/tool/path-manipulator.h +++ b/src/ui/tool/path-manipulator.h @@ -96,7 +96,7 @@ public: NodeList::iterator subdivideSegment(NodeList::iterator after, double t); NodeList::iterator extremeNode(NodeList::iterator origin, bool search_selected, - bool search_unselected, bool closest); + bool search_unselected, bool closest); //BSpline bool isBSpline; int getSteps(); |
