From 07ac80607b7d1b29fb848ba791f53dc017198230 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Sun, 8 Jul 2007 13:12:17 +0000 Subject: [PATCH] integer scale with Alt, instead of slow movement --- src/seltrans.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 56138c51e..1661bdc60 100644 --- 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; @@ -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. */ -- 2.30.2