summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/clonetiler.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp
index 71edcf259..b31eed39c 100644
--- a/src/ui/dialog/clonetiler.cpp
+++ b/src/ui/dialog/clonetiler.cpp
@@ -1315,8 +1315,20 @@ 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 );
+ if (shiftx_exp != 1.0) {
+ if (shifti >= 0.0) {
+ shifti = pow(shifti, shiftx_exp);
+ } else {
+ shifti = -pow(-shifti, shiftx_exp);
+ }
+ }
+ if (shifty_exp != 1.0) {
+ if (shiftj >= 0.0) {
+ shiftj = pow(shiftj, shifty_exp);
+ } else {
+ shiftj = -pow(-shiftj, shifty_exp);
+ }
+ }
// Final shift
Geom::Affine rect_translate (Geom::Translate (w * shifti, h * shiftj));