From 3342fa1df49d51f450c569466910a0dcedbbd1c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Wed, 10 Jan 2018 14:02:16 +0100 Subject: Tiled Cloned: Apply shift exponent to absolute shift --- src/ui/dialog/clonetiler.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src') 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)); -- cgit v1.2.3