From 1e31f41592a438d45d725c14ec7269c33619486d Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sun, 14 Feb 2010 14:13:56 +0100 Subject: [PATCH] Implement snapping of gradient stops --- src/gradient-drag.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp index 5be435a64..0b9068b37 100644 --- a/src/gradient-drag.cpp +++ b/src/gradient-drag.cpp @@ -807,6 +807,12 @@ gr_knot_moved_midpoint_handler(SPKnot */*knot*/, Geom::Point const &ppointer, gu p = snap_vector_midpoint (p, low_lim, high_lim, snap_fraction); } else { p = snap_vector_midpoint (p, low_lim, high_lim, 0); + if (!(state & GDK_SHIFT_MASK)) { + SPDesktop *desktop = dragger->parent->desktop; + SnapManager &m = desktop->namedview->snap_manager; + Inkscape::Snapper::ConstraintLine cl(low_lim, high_lim - low_lim); + m.constrainedSnapReturnByRef(p, Inkscape::SNAPSOURCE_OTHER_HANDLE, cl); + } } Geom::Point displacement = p - dragger->point; -- 2.30.2