From: Diederik van Lierop Date: Sun, 14 Feb 2010 13:13:56 +0000 (+0100) Subject: Implement snapping of gradient stops X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1e31f41592a438d45d725c14ec7269c33619486d;p=inkscape.git Implement snapping of gradient stops --- 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;