summaryrefslogtreecommitdiffstats
path: root/src/object-edit.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2009-08-22 00:29:34 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2009-08-22 00:29:34 +0000
commit3eb6bebd0ebc2b5543b10b56e9b5760541f3ed66 (patch)
tree32ff9283177a92e25dae3955b73bd2d692da2ede /src/object-edit.cpp
parentfix 379817 (diff)
downloadinkscape-3eb6bebd0ebc2b5543b10b56e9b5760541f3ed66.tar.gz
inkscape-3eb6bebd0ebc2b5543b10b56e9b5760541f3ed66.zip
fix 166186
(bzr r8516)
Diffstat (limited to 'src/object-edit.cpp')
-rw-r--r--src/object-edit.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/object-edit.cpp b/src/object-edit.cpp
index ac62a12db..c8e3ab204 100644
--- a/src/object-edit.cpp
+++ b/src/object-edit.cpp
@@ -1111,7 +1111,7 @@ public:
* [control] constrain inner arg to round per PI/4
*/
void
-SpiralKnotHolderEntityInner::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint state)
+SpiralKnotHolderEntityInner::knot_set(Geom::Point const &p, Geom::Point const &origin, guint state)
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
int snaps = prefs->getInt("/options/rotationsnapsperpi/value", 12);
@@ -1121,10 +1121,16 @@ SpiralKnotHolderEntityInner::knot_set(Geom::Point const &p, Geom::Point const &/
gdouble dx = p[Geom::X] - spiral->cx;
gdouble dy = p[Geom::Y] - spiral->cy;
+ gdouble moved_y = p[Geom::Y] - origin[Geom::Y];
+
if (state & GDK_MOD1_MASK) {
// adjust divergence by vertical drag, relative to rad
- double new_exp = (spiral->rad + dy)/(spiral->rad);
- spiral->exp = new_exp > 0? new_exp : 0;
+ if (spiral->rad > 0) {
+ double exp_delta = 0.1*moved_y/(spiral->rad); // arbitrary multiplier to slow it down
+ spiral->exp += exp_delta;
+ if (spiral->exp < 1e-3)
+ spiral->exp = 1e-3;
+ }
} else {
// roll/unroll from inside
gdouble arg_t0;