summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b3cde57)
raw | patch | inline | side by side (parent: b3cde57)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Sun, 8 Jul 2007 13:12:17 +0000 (13:12 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Sun, 8 Jul 2007 13:12:17 +0000 (13:12 +0000) |
src/seltrans.cpp | patch | blob | history |
diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index 56138c51eb9ee1632a52b1ae1cb0a5fe534325c1..1661bdc6009cbe9d8cbd06a24df27b241cfa8f91 100644 (file)
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
@@ -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;
}
}
+ 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.
*/