summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Holder <speleo3@users.sourceforge.net>2008-12-11 11:37:24 +0000
committerspeleo3 <speleo3@users.sourceforge.net>2008-12-11 11:37:24 +0000
commitd2bccac8c64c4ee4b7a61e7ddaace28ac016ddfa (patch)
tree5262b55529f10599ff9197d21d2f382728547472 /src
parentspecify metric units (diff)
downloadinkscape-d2bccac8c64c4ee4b7a61e7ddaace28ac016ddfa.tar.gz
inkscape-d2bccac8c64c4ee4b7a61e7ddaace28ac016ddfa.zip
fixed snapping of handles (broken since rev 20247)
(bzr r6987)
Diffstat (limited to 'src')
-rw-r--r--src/nodepath.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nodepath.cpp b/src/nodepath.cpp
index 1dcf3ed45..f284d818e 100644
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
@@ -132,7 +132,7 @@ static gboolean node_request(SPKnot *knot, Geom::Point const &p, guint state, gp
static void node_handle_clicked(SPKnot *knot, guint state, gpointer data);
static void node_handle_grabbed(SPKnot *knot, guint state, gpointer data);
static void node_handle_ungrabbed(SPKnot *knot, guint state, gpointer data);
-static gboolean node_handle_request(SPKnot *knot, Geom::Point const &p, guint state, gpointer data);
+static gboolean node_handle_request(SPKnot *knot, Geom::Point &p, guint state, gpointer data);
static void node_handle_moved(SPKnot *knot, Geom::Point const &p, guint state, gpointer data);
static gboolean node_handle_event(SPKnot *knot, GdkEvent *event, Inkscape::NodePath::Node *n);
@@ -3908,7 +3908,7 @@ static void node_handle_ungrabbed(SPKnot *knot, guint state, gpointer data)
/**
* Node handle "request" signal callback.
*/
-static gboolean node_handle_request(SPKnot *knot, Geom::Point const &p, guint state, gpointer data)
+static gboolean node_handle_request(SPKnot *knot, Geom::Point &p, guint state, gpointer data)
{
Inkscape::NodePath::Node *n = (Inkscape::NodePath::Node *) data;
@@ -3948,13 +3948,12 @@ static gboolean node_handle_request(SPKnot *knot, Geom::Point const &p, guint st
Inkscape::NodePath::Node *othernode = opposite->other;
Geom::Point const ndelta = n->pos - othernode->pos;
Geom::Coord const linelen = Geom::L2(ndelta);
- Geom::Point ptemp = p;
if (len > NR_EPSILON && linelen > NR_EPSILON) {
Geom::Coord const scal = dot(delta, ndelta) / linelen;
- ptemp = n->pos + (scal / linelen) * ndelta;
+ p = n->pos + (scal / linelen) * ndelta;
}
if ((state & GDK_SHIFT_MASK) == 0) {
- s = m.constrainedSnap(Inkscape::SnapPreferences::SNAPPOINT_NODE, ptemp, Inkscape::Snapper::ConstraintLine(ptemp, ndelta));
+ s = m.constrainedSnap(Inkscape::SnapPreferences::SNAPPOINT_NODE, p, Inkscape::Snapper::ConstraintLine(p, ndelta));
}
} else {
if ((state & GDK_SHIFT_MASK) == 0) {
@@ -3967,6 +3966,8 @@ static gboolean node_handle_request(SPKnot *knot, Geom::Point const &p, guint st
}
}
+ s.getPoint(p);
+
sp_node_adjust_handle(n, -which);
return FALSE;