diff options
Diffstat (limited to 'src/ui/tool/node.cpp')
| -rw-r--r-- | src/ui/tool/node.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index 8e3da266b..e254fb9b2 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -307,12 +307,10 @@ void Handle::dragged(Geom::Point &new_pos, GdkEventMotion *event) std::vector<Inkscape::SnapCandidatePoint> unselected; if (snap) { - typedef ControlPointSelection::Set Set; - Set &nodes = _parent->_selection.allPoints(); - for (Set::iterator i = nodes.begin(); i != nodes.end(); ++i) { + ControlPointSelection::Set &nodes = _parent->_selection.allPoints(); + for (ControlPointSelection::Set::iterator i = nodes.begin(); i != nodes.end(); ++i) { Node *n = static_cast<Node*>(*i); - Inkscape::SnapCandidatePoint p(n->position(), n->_snapSourceType(), n->_snapTargetType()); - unselected.push_back(p); + unselected.push_back(n->snapCandidatePoint()); } sm.setupIgnoreSelection(_desktop, true, &unselected); @@ -326,7 +324,7 @@ void Handle::dragged(Geom::Point &new_pos, GdkEventMotion *event) } else if (ctrl_constraint) { // NOTE: this is subtly wrong. // We should get all possible constraints and snap along them using - // multipleConstrainedSnaps, instead of first snapping to angle and the to objects + // multipleConstrainedSnaps, instead of first snapping to angle and then to objects Inkscape::SnappedPoint p; p = sm.constrainedSnap(Inkscape::SnapCandidatePoint(new_pos, SNAPSOURCE_NODE_HANDLE), *ctrl_constraint); new_pos = p.getPoint(); @@ -1118,6 +1116,11 @@ Inkscape::SnapTargetType Node::_snapTargetType() return SNAPTARGET_NODE_CUSP; } +Inkscape::SnapCandidatePoint Node::snapCandidatePoint() +{ + return SnapCandidatePoint(position(), _snapSourceType(), _snapTargetType()); +} + /** @brief Gets the handle that faces the given adjacent node. * Will abort with error if the given node is not adjacent. */ Handle *Node::handleToward(Node *to) |
