summaryrefslogtreecommitdiffstats
path: root/src/nodepath.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-03-04 20:14:23 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-03-04 20:14:23 +0000
commit719551f8cd7540629e15e6342ed332f4fb0c6c6f (patch)
treea6ca87c23cdfa8e43d8e67d057a332a413868ed6 /src/nodepath.cpp
parentadded new extension to the list of translatables (diff)
downloadinkscape-719551f8cd7540629e15e6342ed332f4fb0c6c6f.tar.gz
inkscape-719551f8cd7540629e15e6342ed332f4fb0c6c6f.zip
Show snapindicator in nodetool :-)
(bzr r4955)
Diffstat (limited to 'src/nodepath.cpp')
-rw-r--r--src/nodepath.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/nodepath.cpp b/src/nodepath.cpp
index 7ea29e791..bc396d378 100644
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
@@ -52,6 +52,7 @@
#include "live_effects/lpeobject.h"
#include "live_effects/parameter/parameter.h"
#include "util/mathfns.h"
+#include "display/snap-indicator.h"
class NR::Matrix;
@@ -1099,6 +1100,7 @@ static void sp_nodepath_selected_nodes_move(Inkscape::NodePath::Path *nodepath,
NR::Coord best = NR_HUGE;
NR::Point delta(dx, dy);
NR::Point best_pt = delta;
+ NR::Point best_abs(NR_HUGE, NR_HUGE);
if (snap) {
SnapManager const &m = nodepath->desktop->namedview->snap_manager;
@@ -1108,9 +1110,13 @@ static void sp_nodepath_selected_nodes_move(Inkscape::NodePath::Path *nodepath,
Inkscape::SnappedPoint const s = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, n->pos + delta, SP_PATH(n->subpath->nodepath->item));
if (s.getDistance() < best) {
best = s.getDistance();
- best_pt = s.getPoint() - n->pos;
+ best_abs = s.getPoint();
+ best_pt = best_abs - n->pos;
}
}
+ if (best_abs[NR::X] < NR_HUGE) {
+ nodepath->desktop->snapindicator->set_new_snappoint(best_abs.to_2geom());
+ }
}
for (GList *l = nodepath->selected; l != NULL; l = l->next) {
@@ -3255,6 +3261,8 @@ node_request(SPKnot */*knot*/, NR::Point *p, guint state, gpointer data)
Inkscape::NodePath::Node *n = (Inkscape::NodePath::Node *) data;
+ n->subpath->nodepath->desktop->snapindicator->remove_snappoint();
+
// If either (Shift and some handle retracted), or (we're already dragging out a handle)
if ( (!n->subpath->nodepath->straight_path) &&
( ((state & GDK_SHIFT_MASK) && ((n->n.other && n->n.pos == n->pos) || (n->p.other && n->p.pos == n->pos)))