From 86f80d1c9bd6cc3716c049da3d8c94887211648e Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sat, 7 Mar 2009 20:47:00 +0000 Subject: - When finalizing a curve by double clicking then don't snap to the curve itself - When a node and an intersection coincide then snap to the node, not the intersection (but only if snapping is turned on for both of them of course) (bzr r7438) --- src/draw-context.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/draw-context.cpp') diff --git a/src/draw-context.cpp b/src/draw-context.cpp index b860c457d..c86e2cc69 100644 --- a/src/draw-context.cpp +++ b/src/draw-context.cpp @@ -507,7 +507,7 @@ void spdc_endpoint_snap_rotation(SPEventContext const *const ec, Geom::Point &p, p = o + bdot * best; if (!(state & GDK_SHIFT_MASK)) { //SHIFT disables all snapping, except the angular snapping above - //After all, the user explicitely asked for angular snapping by + //After all, the user explicitly asked for angular snapping by //pressing CTRL /* Snap it along best vector */ SnapManager &m = SP_EVENT_CONTEXT_DESKTOP(ec)->namedview->snap_manager; @@ -522,8 +522,14 @@ void spdc_endpoint_snap_rotation(SPEventContext const *const ec, Geom::Point &p, void spdc_endpoint_snap_free(SPEventContext const * const ec, Geom::Point& p, guint const /*state*/) { - SnapManager &m = SP_EVENT_CONTEXT_DESKTOP(ec)->namedview->snap_manager; - m.setup(SP_EVENT_CONTEXT_DESKTOP(ec)); + SPDesktop *dt = SP_EVENT_CONTEXT_DESKTOP(ec); + SnapManager &m = dt->namedview->snap_manager; + Inkscape::Selection *selection = sp_desktop_selection (dt); + + // selection->singleItem() is the item that is currently being drawn. This item will not be snapped to (to avoid self-snapping) + // TODO: Allow snapping to the stationary parts of the item, and only ignore the last segment + + m.setup(dt, true, selection->singleItem()); Geom::Point pt2g = to_2geom(p); m.freeSnapReturnByRef(Inkscape::SnapPreferences::SNAPPOINT_NODE, pt2g, Inkscape::SNAPSOURCE_HANDLE); p = from_2geom(pt2g); -- cgit v1.2.3