summaryrefslogtreecommitdiff
path: root/basegfx/source/tools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-01-22 13:25:44 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2016-01-22 23:54:20 +0000
commit3fc292f7b32f30b98dad208eb03e086b927d38a2 (patch)
tree94c0fcc02274e24d354fda24d3bfb251a9c2e3a5 /basegfx/source/tools
parentd8df6631ac173a920be834096c522014732ac151 (diff)
loplugin:fpcomparison in basegfx
fix comparing of floating point values Change-Id: I54db66968cb999514747171eed82082612e0cac8 Reviewed-on: https://gerrit.libreoffice.org/21708 Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'basegfx/source/tools')
-rw-r--r--basegfx/source/tools/gradienttools.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/basegfx/source/tools/gradienttools.cxx b/basegfx/source/tools/gradienttools.cxx
index 11bd62f61843..e8f2f3091d4f 100644
--- a/basegfx/source/tools/gradienttools.cxx
+++ b/basegfx/source/tools/gradienttools.cxx
@@ -176,7 +176,7 @@ namespace basegfx
aTextureTransform.translate(fTargetOffsetX, fTargetOffsetY);
// prepare aspect for texture
- const double fAspectRatio((0.0 != fTargetSizeY) ? fTargetSizeX / fTargetSizeY : 1.0);
+ const double fAspectRatio(rtl::math::approxEqual(0.0, fTargetSizeY) ? 1.0 : (fTargetSizeX / fTargetSizeY));
return ODFGradientInfo(aTextureTransform, fAspectRatio, nSteps);
}
@@ -253,7 +253,7 @@ namespace basegfx
aTextureTransform.translate(fTargetOffsetX, fTargetOffsetY);
// prepare aspect for texture
- const double fAspectRatio((0.0 != fTargetSizeY) ? fTargetSizeX / fTargetSizeY : 1.0);
+ const double fAspectRatio(rtl::math::approxEqual(0.0, fTargetSizeY) ? 1.0 : (fTargetSizeX / fTargetSizeY));
return ODFGradientInfo(aTextureTransform, fAspectRatio, nSteps);
}