summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2008-05-18 20:38:43 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2008-05-18 20:38:43 +0000
commit47a4dc2b73ff06c8f7529e197dbf2a8d67e51311 (patch)
tree3ee01dcfebb7f07cf15dd4dcd803a97b847784d9 /src
parentEliminate some redundant snapping calls (diff)
downloadinkscape-47a4dc2b73ff06c8f7529e197dbf2a8d67e51311.tar.gz
inkscape-47a4dc2b73ff06c8f7529e197dbf2a8d67e51311.zip
Fix regression in constrained translation
(bzr r5694)
Diffstat (limited to 'src')
-rw-r--r--src/seltrans.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index 94baf12d7..bdb0f794a 100644
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
@@ -1430,19 +1430,21 @@ void Inkscape::SelTrans::moveTo(NR::Point const &xy, guint state)
if (best_snapped_point.getSnapped()) {
_desktop->snapindicator->set_new_snappoint(best_snapped_point);
} else {
- _desktop->snapindicator->remove_snappoint();
+ // We didn't snap, so remove any previous snap indicator
+ _desktop->snapindicator->remove_snappoint();
+ if (control) {
+ // If we didn't snap, then we should still constrain horizontally or vertically
+ // (When we did snap, then this constraint has already been enforced by
+ // calling constrainedSnapTranslation() above)
+ if (fabs(dxy[NR::X]) > fabs(dxy[NR::Y])) {
+ dxy[NR::Y] = 0;
+ } else {
+ dxy[NR::X] = 0;
+ }
+ }
}
}
-
- //if (control) {
- // /* Ensure that the horizontal and vertical constraint has been applied */
- // if (fabs(dxy[NR::X]) > fabs(dxy[NR::Y])) {
- // dxy[NR::Y] = 0;
- // } else {
- // dxy[NR::X] = 0;
- // }
- //}
-
+
NR::Matrix const move((NR::translate(dxy)));
NR::Point const norm(0, 0);
transform(move, norm);