diff options
| author | Diederik van Lierop <mailat-signdiedenrezidotnl> | 2010-01-23 13:36:56 +0000 |
|---|---|---|
| committer | Diederik van Lierop <mailat-signdiedenrezidotnl> | 2010-01-23 13:36:56 +0000 |
| commit | c4aa590bedcf358acf15bdf0d8134ae99e3be167 (patch) | |
| tree | 6808d0d57dfb83e91d02762c3c12225f1053c83e /src/draw-context.cpp | |
| parent | Fix some of the LPE issues. (diff) | |
| download | inkscape-c4aa590bedcf358acf15bdf0d8134ae99e3be167.tar.gz inkscape-c4aa590bedcf358acf15bdf0d8134ae99e3be167.zip | |
Remove redundancy from snapping API (type of snapsource no longer has to be specified explicitly)
(bzr r9014)
Diffstat (limited to 'src/draw-context.cpp')
| -rw-r--r-- | src/draw-context.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/draw-context.cpp b/src/draw-context.cpp index 3334c82de..da22c8a7a 100644 --- a/src/draw-context.cpp +++ b/src/draw-context.cpp @@ -511,7 +511,7 @@ void spdc_endpoint_snap_rotation(SPEventContext const *const ec, Geom::Point &p, /* Snap it along best vector */ SnapManager &m = SP_EVENT_CONTEXT_DESKTOP(ec)->namedview->snap_manager; m.setup(SP_EVENT_CONTEXT_DESKTOP(ec)); - m.constrainedSnapReturnByRef( Inkscape::SnapPreferences::SNAPPOINT_NODE, p, Inkscape::SNAPSOURCE_HANDLE, Inkscape::Snapper::ConstraintLine(best)); + m.constrainedSnapReturnByRef(p, Inkscape::SNAPSOURCE_NODE_HANDLE, Inkscape::Snapper::ConstraintLine(best)); } } } @@ -520,16 +520,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*/) { SPDesktop *dt = SP_EVENT_CONTEXT_DESKTOP(ec); - SnapManager &m = dt->namedview->snap_manager; - Inkscape::Selection *selection = sp_desktop_selection (dt); + 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 + // 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); + m.setup(dt, true, selection->singleItem()); + m.freeSnapReturnByRef(p, Inkscape::SNAPSOURCE_NODE_HANDLE); } static SPCurve * |
