summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2018-01-10 23:19:40 +0000
committerMarc Jeanmougin <marc@jeanmougin.fr>2018-01-10 23:19:40 +0000
commit401fc4c24ead2289a8d4969b05ec365b917916c9 (patch)
tree8283df8b2443e1c5340b094e820e913d8c124217 /src
parentConvert mesh-toolbar to use ink-select-one-action. (diff)
parentTiled Cloned: Remove check for 1.0 in shift exponent code (diff)
downloadinkscape-401fc4c24ead2289a8d4969b05ec365b917916c9.tar.gz
inkscape-401fc4c24ead2289a8d4969b05ec365b917916c9.zip
Merge branch 'clonetiler-negative-shift' of gitlab.com:thestr4ng3r/inkscape
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/clonetiler.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp
index 71edcf259..2abd6af6b 100644
--- a/src/ui/dialog/clonetiler.cpp
+++ b/src/ui/dialog/clonetiler.cpp
@@ -1315,8 +1315,10 @@ Geom::Affine CloneTiler::get_transform(
if( !shifty_excludeh ) shiftj += j;
// Add exponential shift if necessary
- if ( shiftx_exp != 1.0 ) shifti = pow( shifti, shiftx_exp );
- if ( shifty_exp != 1.0 ) shiftj = pow( shiftj, shifty_exp );
+ double shifti_sign = (shifti > 0.0) ? 1.0 : -1.0;
+ shifti = shifti_sign * pow(fabs(shifti), shiftx_exp);
+ double shiftj_sign = (shiftj > 0.0) ? 1.0 : -1.0;
+ shiftj = shiftj_sign * pow(fabs(shiftj), shifty_exp);
// Final shift
Geom::Affine rect_translate (Geom::Translate (w * shifti, h * shiftj));