From 6edc17e9611bfc1875cf3fdbaf8fb1ce3c820b89 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Thu, 25 Feb 2010 22:54:44 +0100 Subject: 1) Fix moving by an integer multiple of the grid spacing (-dragging in the selector tool) 2) Allow constrained translation for 1) (with ) 3) Fix snapping to the grid when pasting 4) Show snap indicators for all of the above 5) Implement snap delay mechanism for 1) and 2) (bzr r9113) --- src/seltrans.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/seltrans.cpp') diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 1c601b3ea..7a08e0a7e 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -1439,13 +1439,17 @@ void Inkscape::SelTrans::moveTo(Geom::Point const &xy, guint state) if (alt) { - /* Alt pressed means keep offset: snap the moved distance to the grid. - ** FIXME: this will snap to more than just the grid, nowadays. - */ + // Alt pressed means: move only by integer multiples of the grid spacing + if (control) { // ... if also constrained to the orthogonal axes + if (fabs(dxy[Geom::X]) > fabs(dxy[Geom::Y])) { + dxy[Geom::Y] = 0; + } else { + dxy[Geom::X] = 0; + } + } m.setup(_desktop, true, _items_const); - m.freeSnapReturnByRef(dxy, Inkscape::SNAPSOURCE_UNDEFINED); - + dxy = m.multipleOfGridPitch(dxy, _point); } else if (shift) { if (control) { // shift & control: constrained movement without snapping if (fabs(dxy[Geom::X]) > fabs(dxy[Geom::Y])) { -- cgit v1.2.3