Code

Filter effects dialog:
[inkscape.git] / src / seltrans.cpp
index 56138c51eb9ee1632a52b1ae1cb0a5fe534325c1..1661bdc6009cbe9d8cbd06a24df27b241cfa8f91 100644 (file)
@@ -765,10 +765,6 @@ gboolean Inkscape::SelTrans::handleRequest(SPKnot *knot, NR::Point *position, gu
 
     knot->desktop->setPosition(*position);
 
-    if (state & GDK_MOD1_MASK) {
-        *position = _point + ( *position - _point ) / 10;
-    }
-
     if ((!(state & GDK_SHIFT_MASK) == !(_state == STATE_ROTATE)) && (&handle != &handle_center)) {
         _origin = _opposite;
         _origin_for_bboxpoints = _opposite_for_bboxpoints;
@@ -881,6 +877,15 @@ gboolean Inkscape::SelTrans::scaleRequest(NR::Point &pt, guint state)
         }
     }
 
+    if (state & GDK_MOD1_MASK) { // scale by an integer multiplier/divider
+        for ( unsigned int i = 0 ; i < 2 ; i++ ) {
+            if (fabs(s[i]) > 1) 
+                s[i] = round(s[i]);
+            else 
+                s[i] = 1/round(1/(MIN(s[i], 10)));
+        }
+    }
+
     SnapManager const &m = _desktop->namedview->snap_manager;
 
     /* Get a STL list of the selected items.
@@ -1009,6 +1014,13 @@ gboolean Inkscape::SelTrans::stretchRequest(SPSelTransHandle const &handle, NR::
         s[axis] = 1e-15;
     }
 
+    if (state & GDK_MOD1_MASK) { // scale by an integer multiplier/divider
+        if (fabs(s[axis]) > 1) 
+            s[axis] = round(s[axis]);
+        else 
+            s[axis] = 1/round(1/(MIN(s[axis], 10)));
+    }
+
     /* Get a STL list of the selected items.
     ** FIXME: this should probably be done by Inkscape::Selection.
     */