summaryrefslogtreecommitdiffstats
path: root/src/seltrans.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2009-04-21 19:10:22 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2009-04-21 19:10:22 +0000
commita5464ad5ac66d8dbcfe9d1e7f156b149caddf1cd (patch)
tree5b04d909aee24dba8d87694ced7aecaf39ce1019 /src/seltrans.cpp
parent* [INTL: sk] Slovak translation update (trunk) (diff)
downloadinkscape-a5464ad5ac66d8dbcfe9d1e7f156b149caddf1cd.tar.gz
inkscape-a5464ad5ac66d8dbcfe9d1e7f156b149caddf1cd.zip
Fix constrained motion in the selector tool when snapping is being overridden (i.e. when ctrl+shift keys are pressed simultaneously)
(bzr r7755)
Diffstat (limited to 'src/seltrans.cpp')
-rw-r--r--src/seltrans.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index 816a471cf..64f7d3cdc 100644
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
@@ -1400,7 +1400,15 @@ void Inkscape::SelTrans::moveTo(Geom::Point const &xy, guint state)
m.setup(_desktop, true, _items_const);
m.freeSnapReturnByRef(SnapPreferences::SNAPPOINT_NODE, dxy, Inkscape::SNAPSOURCE_UNDEFINED);
- } else if (!shift) {
+ } else if (shift) {
+ if (control) { // shift & control: constrained movement without snapping
+ if (fabs(dxy[Geom::X]) > fabs(dxy[Geom::Y])) {
+ dxy[Geom::Y] = 0;
+ } else {
+ dxy[Geom::X] = 0;
+ }
+ }
+ } else { //!shift: with snapping
/* We're snapping to things, possibly with a constraint to horizontal or
** vertical movement. Obtain a list of possible translations and then
@@ -1412,7 +1420,7 @@ void Inkscape::SelTrans::moveTo(Geom::Point const &xy, guint state)
/* This will be our list of possible translations */
std::list<Inkscape::SnappedPoint> s;
- if (control) {
+ if (control) { // constrained movement with snapping
/* Snap to things, and also constrain to horizontal or vertical movement */
@@ -1433,7 +1441,7 @@ void Inkscape::SelTrans::moveTo(Geom::Point const &xy, guint state)
_point,
Inkscape::Snapper::ConstraintLine(component_vectors[dim]),
dxy));
- } else {
+ } else { // !control
// Let's leave this timer code here for a while. I'll probably need it in the near future (Diederik van Lierop)
/* GTimeVal starttime;