diff options
Diffstat (limited to 'src/draw-context.cpp')
| -rw-r--r-- | src/draw-context.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/draw-context.cpp b/src/draw-context.cpp index ebc6e320f..15b20f124 100644 --- a/src/draw-context.cpp +++ b/src/draw-context.cpp @@ -501,7 +501,7 @@ void spdc_endpoint_snap_rotation(SPEventContext const *const ec, Geom::Point &p, } -void spdc_endpoint_snap_free(SPEventContext const * const ec, Geom::Point& p, boost::optional<Geom::Point> &start_point, guint const /*state*/) +void spdc_endpoint_snap_free(SPEventContext const * const ec, Geom::Point& p, boost::optional<Geom::Point> &start_of_line, guint const /*state*/) { SPDesktop *dt = SP_EVENT_CONTEXT_DESKTOP(ec); SnapManager &m = dt->namedview->snap_manager; @@ -511,7 +511,14 @@ void spdc_endpoint_snap_free(SPEventContext const * const ec, Geom::Point& p, bo // TODO: Allow snapping to the stationary parts of the item, and only ignore the last segment m.setup(dt, true, selection->singleItem()); - m.freeSnapReturnByRef(p, Inkscape::SNAPSOURCE_NODE_HANDLE, start_point); + Inkscape::SnapCandidatePoint scp(p, Inkscape::SNAPSOURCE_NODE_HANDLE); + if (start_of_line) { + scp.addOrigin(*start_of_line); + } + + Inkscape::SnappedPoint sp = m.freeSnap(scp); + p = sp.getPoint(); + m.unSetup(); } |
