summaryrefslogtreecommitdiffstats
path: root/src/nodepath.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2008-07-21 21:28:17 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2008-07-21 21:28:17 +0000
commit0e53fca3e7a272c316e1d666afd51293c6262f6c (patch)
tree6bcc357507f25c420de4919eb4c7dbce6dd8d9ce /src/nodepath.cpp
parentImplement snapping of clipping paths and masks (diff)
downloadinkscape-0e53fca3e7a272c316e1d666afd51293c6262f6c.tar.gz
inkscape-0e53fca3e7a272c316e1d666afd51293c6262f6c.zip
Disable snapping when holding the shift-key while dragging node-handles
(bzr r6387)
Diffstat (limited to 'src/nodepath.cpp')
-rw-r--r--src/nodepath.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/nodepath.cpp b/src/nodepath.cpp
index 023f931f2..387cf1b0a 100644
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
@@ -3702,7 +3702,7 @@ static void node_handle_ungrabbed(SPKnot *knot, guint state, gpointer data)
/**
* Node handle "request" signal callback.
*/
-static gboolean node_handle_request(SPKnot *knot, NR::Point *p, guint /*state*/, gpointer data)
+static gboolean node_handle_request(SPKnot *knot, NR::Point *p, guint state, gpointer data)
{
Inkscape::NodePath::Node *n = (Inkscape::NodePath::Node *) data;
@@ -3725,7 +3725,13 @@ static gboolean node_handle_request(SPKnot *knot, NR::Point *p, guint /*state*/,
SPDesktop *desktop = n->subpath->nodepath->desktop;
SnapManager &m = desktop->namedview->snap_manager;
m.setup(desktop, n->subpath->nodepath->item);
- Inkscape::SnappedPoint s ;
+ Inkscape::SnappedPoint s;
+
+ if ((state & GDK_SHIFT_MASK) != 0) {
+ // We will not try to snap when the shift-key is pressed
+ // so remove the old snap indicator and don't wait for it to time-out
+ desktop->snapindicator->remove_snappoint();
+ }
Inkscape::NodePath::Node *othernode = opposite->other;
if (othernode) {
@@ -3740,12 +3746,18 @@ static gboolean node_handle_request(SPKnot *knot, NR::Point *p, guint /*state*/,
NR::Coord const scal = dot(delta, ndelta) / linelen;
(*p) = n->pos + (scal / linelen) * ndelta;
}
- s = m.constrainedSnap(Inkscape::Snapper::SNAPPOINT_NODE, *p, Inkscape::Snapper::ConstraintLine(*p, ndelta));
+ if ((state & GDK_SHIFT_MASK) == 0) {
+ s = m.constrainedSnap(Inkscape::Snapper::SNAPPOINT_NODE, *p, Inkscape::Snapper::ConstraintLine(*p, ndelta));
+ }
} else {
- s = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, *p);
+ if ((state & GDK_SHIFT_MASK) == 0) {
+ s = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, *p);
+ }
}
} else {
- s = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, *p);
+ if ((state & GDK_SHIFT_MASK) == 0) {
+ s = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, *p);
+ }
}
s.getPoint(*p);