diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index 9c874c242cb666d8d2b07f18c92deb0e7b1846bd..1661bdc6009cbe9d8cbd06a24df27b241cfa8f91 100644 (file)
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
@@ -310,6 +310,8 @@ void Inkscape::SelTrans::grab(NR::Point const &p, gdouble x, gdouble y, bool sho
_opposite = _opposite_for_bboxpoints;
}
+ // The lines below are usefull for debugging any snapping issues, as they'll spit out all points that are considered for snapping
+
/*std::cout << "Number of snap points: " << _snap_points.size() << std::endl;
for (std::vector<NR::Point>::const_iterator i = _snap_points.begin(); i != _snap_points.end(); i++)
{
@@ -763,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;
}
}
+ 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.
@@ -1007,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.
*/