summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorian Märkl <info@florianmaerkl.de>2018-01-10 13:48:09 +0000
committerFlorian Märkl <info@florianmaerkl.de>2018-01-10 13:48:09 +0000
commitf7c1a4aed08fc3124638307b90eb46ebf826db6c (patch)
tree445d817a892a071f3fe91e705fc077bd504720d9 /src
parentTiled Cloned: Apply shift exponent to absolute shift (diff)
downloadinkscape-f7c1a4aed08fc3124638307b90eb46ebf826db6c.tar.gz
inkscape-f7c1a4aed08fc3124638307b90eb46ebf826db6c.zip
Tiled Cloned: Simplify shift exponent code
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/clonetiler.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp
index b31eed39c..30cc98736 100644
--- a/src/ui/dialog/clonetiler.cpp
+++ b/src/ui/dialog/clonetiler.cpp
@@ -1316,18 +1316,12 @@ Geom::Affine CloneTiler::get_transform(
// Add exponential shift if necessary
if (shiftx_exp != 1.0) {
- if (shifti >= 0.0) {
- shifti = pow(shifti, shiftx_exp);
- } else {
- shifti = -pow(-shifti, shiftx_exp);
- }
+ double sign = (shifti > 0.0) ? 1.0 : -1.0;
+ shifti = sign * pow(fabs(shifti), shiftx_exp);
}
if (shifty_exp != 1.0) {
- if (shiftj >= 0.0) {
- shiftj = pow(shiftj, shifty_exp);
- } else {
- shiftj = -pow(-shiftj, shifty_exp);
- }
+ double sign = (shiftj > 0.0) ? 1.0 : -1.0;
+ shiftj = sign * pow(fabs(shiftj), shifty_exp);
}
// Final shift