diff options
| author | Diederik van Lierop <mailat-signdiedenrezidotnl> | 2010-02-25 21:54:44 +0000 |
|---|---|---|
| committer | Diederik van Lierop <mailat-signdiedenrezidotnl> | 2010-02-25 21:54:44 +0000 |
| commit | 6edc17e9611bfc1875cf3fdbaf8fb1ce3c820b89 (patch) | |
| tree | 9e88824107418e33478f6143ca44b95f607e84d3 /src/seltrans.cpp | |
| parent | fix warnings (diff) | |
| download | inkscape-6edc17e9611bfc1875cf3fdbaf8fb1ce3c820b89.tar.gz inkscape-6edc17e9611bfc1875cf3fdbaf8fb1ce3c820b89.zip | |
1) Fix moving by an integer multiple of the grid spacing (<alt>-dragging in the selector tool)
2) Allow constrained translation for 1) (with <ctrl>)
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)
Diffstat (limited to 'src/seltrans.cpp')
| -rw-r--r-- | src/seltrans.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
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])) { |
