summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b96c89e)
raw | patch | inline | side by side (parent: b96c89e)
author | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Sun, 18 May 2008 20:38:43 +0000 (20:38 +0000) | ||
committer | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Sun, 18 May 2008 20:38:43 +0000 (20:38 +0000) |
src/seltrans.cpp | patch | blob | history |
diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index 94baf12d709bb5337873996da0840ad23bd1e941..bdb0f794a84a48cc70e1dc26dddcc7da4904af04 100644 (file)
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
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);