diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2014-01-02 15:15:27 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2014-01-02 15:15:27 +0000 |
| commit | c08c28e9a22f0fe5f06e9dc34430c3acb16f3c13 (patch) | |
| tree | dc64d1ef21b86f0907a254f89391f5b4aa1860ba /src/ui/tool | |
| parent | fix a bug whith degenerate handles (diff) | |
| download | inkscape-c08c28e9a22f0fe5f06e9dc34430c3acb16f3c13.tar.gz inkscape-c08c28e9a22f0fe5f06e9dc34430c3acb16f3c13.zip | |
Fixed a boring bug sometimes curves be converted to lines, increasing a bit the distance from the handle to the line
(bzr r11950.1.230)
Diffstat (limited to 'src/ui/tool')
| -rw-r--r-- | src/ui/tool/node.cpp | 21 | ||||
| -rw-r--r-- | src/ui/tool/path-manipulator.cpp | 6 |
2 files changed, 20 insertions, 7 deletions
diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index a932e5b7b..39b21ae6d 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -1388,6 +1388,12 @@ Node *Node::nodeAwayFrom(Handle *h) Glib::ustring Node::_getTip(unsigned state) const { + //spanish: un truco par, si el nodo tiene fuerza, nos marca que es + //del tipo bspline, lo utilizaremos despues para mostras los mensajes apropiados + //no lo podemos hacer de otra forma al ser constante la funcion + bool isBSpline = false; + if( this->bsplineWeight != 0.0000) + isBSpline = true; if (state_held_shift(state)) { bool can_drag_out = (_next() && _front.isDegenerate()) || (_prev() && _back.isDegenerate()); if (can_drag_out) { @@ -1417,15 +1423,24 @@ Glib::ustring Node::_getTip(unsigned state) const // No modifiers: assemble tip from node type char const *nodetype = node_type_to_localized_string(_type); if (_selection.transformHandlesEnabled() && selected()) { - if (_selection.size() == 1) { + if (_selection.size() == 1 && !isBSpline) { return format_tip(C_("Path node tip", "<b>%s</b>: drag to shape the path (more: Shift, Ctrl, Alt)"), nodetype); + }else if(_selection.size() == 1){ + return format_tip(C_("Path node tip", + "<b>BSpline node</b>: %g weight, drag to shape the path (more: Shift, Ctrl, Alt)"),this->bsplineWeight); } return format_tip(C_("Path node tip", "<b>%s</b>: drag to shape the path, click to toggle scale/rotation handles (more: Shift, Ctrl, Alt)"), nodetype); } - return format_tip(C_("Path node tip", - "<b>%s</b>: drag to shape the path, click to select only this node (more: Shift, Ctrl, Alt)"), nodetype); + if (!isBSpline) { + return format_tip(C_("Path node tip", + "<b>%s</b>: drag to shape the path, click to select only this node (more: Shift, Ctrl, Alt)"), nodetype); + }else{ + return format_tip(C_("Path node tip", + "<b>BSpline node</b>: drag to shape the path, click to select only this node (more: Shift, Ctrl, Alt)")); + + } } Glib::ustring Node::_getDragTip(GdkEventMotion */*event*/) const diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index e70717728..cda8374c5 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -1219,13 +1219,11 @@ double PathManipulator::BSplineHandlePosition(Handle *h){ Node *n = h->parent(); Node * nextNode = NULL; nextNode = n->nodeToward(h); - Geom::Point positionH = h->position(); - positionH = Geom::Point(positionH[X] + 0.0001,positionH[Y] + 0.0001); if(nextNode && n->position() != h->position()){ SPCurve *lineInsideNodes = new SPCurve(); lineInsideNodes->moveto(n->position()); lineInsideNodes->lineto(nextNode->position()); - pos = Geom::nearest_point(positionH,*lineInsideNodes->first_segment()); + pos = Geom::nearest_point(h->position(),*lineInsideNodes->first_segment()); } return pos; } @@ -1252,7 +1250,7 @@ Geom::Point PathManipulator::BSplineHandleReposition(Handle *h,double pos){ SBasisInsideNodes = lineInsideNodes->first_segment()->toSBasis(); n->bsplineWeight = pos; ret = SBasisInsideNodes.valueAt(pos); - ret = Geom::Point(ret[X] + 0.0001,ret[Y] + 0.0001); + ret = Geom::Point(ret[X] + 0.005,ret[Y] + 0.005); }else{ if(pos == 0.0000){ n->bsplineWeight = 0.0000; |
