diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2010-01-31 00:46:57 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2010-01-31 00:46:57 +0000 |
| commit | 50e11282e1144f17f54bd1c4cbfa55ecb6e7f0ed (patch) | |
| tree | d34b9ebb01a8fbed7ce572bfe13a0f0f26659ff0 /src/ui/tool/node.cpp | |
| parent | Finally introducing the pre-snap indicator (diff) | |
| download | inkscape-50e11282e1144f17f54bd1c4cbfa55ecb6e7f0ed.tar.gz inkscape-50e11282e1144f17f54bd1c4cbfa55ecb6e7f0ed.zip | |
Fix constrained snapping in node tool.
(bzr r9035)
Diffstat (limited to '')
| -rw-r--r-- | src/ui/tool/node.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index f2bec1f5f..2675b4045 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -872,6 +872,7 @@ void Node::_draggedHandler(Geom::Point &new_pos, GdkEventMotion *event) if (held_control(*event)) { Geom::Point origin = _last_drag_origin(); + Inkscape::SnappedPoint fp, bp; if (held_alt(*event)) { // with Ctrl+Alt, constrain to handle lines // project the new position onto a handle line that is closer @@ -880,10 +881,10 @@ void Node::_draggedHandler(Geom::Point &new_pos, GdkEventMotion *event) // TODO: combine these two branches by modifying snap.h / snap.cpp if (snap) { - Inkscape::SnappedPoint fp, bp; fp = sm.constrainedSnap(Inkscape::SnapCandidatePoint(position(), _snapSourceType()), line_front); bp = sm.constrainedSnap(Inkscape::SnapCandidatePoint(position(), _snapSourceType()), line_back); - + } + if (fp.getSnapped() || bp.getSnapped()) { if (fp.isOtherSnapBetter(bp, false)) { bp.getPoint(new_pos); } else { @@ -902,12 +903,12 @@ void Node::_draggedHandler(Geom::Point &new_pos, GdkEventMotion *event) // with Ctrl, constrain to axes // TODO combine the two branches if (snap) { - Inkscape::SnappedPoint fp, bp; Inkscape::Snapper::ConstraintLine line_x(origin, Geom::Point(1, 0)); Inkscape::Snapper::ConstraintLine line_y(origin, Geom::Point(0, 1)); fp = sm.constrainedSnap(Inkscape::SnapCandidatePoint(position(), _snapSourceType()), line_x); bp = sm.constrainedSnap(Inkscape::SnapCandidatePoint(position(), _snapSourceType()), line_y); - + } + if (fp.getSnapped() || bp.getSnapped()) { if (fp.isOtherSnapBetter(bp, false)) { fp = bp; } |
