diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2009-03-07 20:47:00 +0000 |
|---|---|---|
| committer | dvlierop2 <dvlierop2@users.sourceforge.net> | 2009-03-07 20:47:00 +0000 |
| commit | 86f80d1c9bd6cc3716c049da3d8c94887211648e (patch) | |
| tree | bed9547bd809863fa7c66af9ec1f1c654f1f8b54 /src/draw-context.cpp | |
| parent | Snap indicators and filters, mainly... (diff) | |
| download | inkscape-86f80d1c9bd6cc3716c049da3d8c94887211648e.tar.gz inkscape-86f80d1c9bd6cc3716c049da3d8c94887211648e.zip | |
- 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)
Diffstat (limited to 'src/draw-context.cpp')
| -rw-r--r-- | src/draw-context.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
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); |
