summaryrefslogtreecommitdiffstats
path: root/src/seltrans.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2007-07-08 13:12:17 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2007-07-08 13:12:17 +0000
commit7b9e277dd599f30a3172b25c34bb7cbcfd513193 (patch)
treee72f12989a615c16978a630dc90bbe2c5976e887 /src/seltrans.cpp
parentRemoved Makefile.am reference to files removed in r15312 (diff)
downloadinkscape-7b9e277dd599f30a3172b25c34bb7cbcfd513193.tar.gz
inkscape-7b9e277dd599f30a3172b25c34bb7cbcfd513193.zip
integer scale with Alt, instead of slow movement
(bzr r3193)
Diffstat (limited to 'src/seltrans.cpp')
-rw-r--r--src/seltrans.cpp20
1 files 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.
*/