diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2011-09-16 23:00:05 +0000 |
|---|---|---|
| committer | Diederik van Lierop <mail@diedenrezi.nl> | 2011-09-16 23:00:05 +0000 |
| commit | ee17bac8a5d9b6bf840272885c1eda57c45fb4ad (patch) | |
| tree | 2df5e6001c742e2f7a73007977c75ecd86fb7947 /src/ui/tool/node.cpp | |
| parent | Correct the formula of the displacement map so that zero alpha value (diff) | |
| download | inkscape-ee17bac8a5d9b6bf840272885c1eda57c45fb4ad.tar.gz inkscape-ee17bac8a5d9b6bf840272885c1eda57c45fb4ad.zip | |
Node tool, transforming a set of nodes: Fix crashes, and finish implementation of snapping
Fixed bugs:
- https://launchpad.net/bugs/590261
(bzr r10633)
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) |
