summaryrefslogtreecommitdiffstats
path: root/src/nodepath.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-03-04 20:27:20 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-03-04 20:27:20 +0000
commit66a64a1308d12b7e82398c3b01c0f8966caf5c03 (patch)
tree1abd13795c920fcf116b39cf7127407505800bcc /src/nodepath.cpp
parentShow snapindicator in nodetool :-) (diff)
downloadinkscape-66a64a1308d12b7e82398c3b01c0f8966caf5c03.tar.gz
inkscape-66a64a1308d12b7e82398c3b01c0f8966caf5c03.zip
snapindicator for nodehandle editing. buggy when doing constraintsnap, don't know how to fix it. Diederik? :)
(bzr r4956)
Diffstat (limited to 'src/nodepath.cpp')
-rw-r--r--src/nodepath.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/nodepath.cpp b/src/nodepath.cpp
index bc396d378..c7e6f7001 100644
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
@@ -3528,7 +3528,7 @@ static gboolean node_handle_request(SPKnot *knot, NR::Point *p, guint /*state*/,
NRPathcode const othercode = sp_node_path_code_from_side(n, opposite);
SnapManager const &m = n->subpath->nodepath->desktop->namedview->snap_manager;
-
+ Inkscape::SnappedPoint s ;
if (opposite->other && (n->type != Inkscape::NodePath::NODE_CUSP) && (othercode == NR_LINETO)) {
/* We are smooth node adjacent with line */
NR::Point const delta = *p - n->pos;
@@ -3540,9 +3540,13 @@ 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;
}
- *p = m.constrainedSnap(Inkscape::Snapper::SNAPPOINT_NODE, *p, Inkscape::Snapper::ConstraintLine(*p, ndelta), n->subpath->nodepath->item).getPoint();
+ s = m.constrainedSnap(Inkscape::Snapper::SNAPPOINT_NODE, *p, Inkscape::Snapper::ConstraintLine(*p, ndelta), n->subpath->nodepath->item);
} else {
- *p = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, *p, n->subpath->nodepath->item).getPoint();
+ s = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, *p, n->subpath->nodepath->item);
+ }
+ *p = s.getPoint();
+ if (s.getDistance() < NR_HUGE) {
+ n->subpath->nodepath->desktop->snapindicator->set_new_snappoint((*p).to_2geom());
}
sp_node_adjust_handle(n, -which);