summaryrefslogtreecommitdiff
path: root/include/basegfx
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 /include/basegfx
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 'include/basegfx')
-rw-r--r--include/basegfx/tuple/b2dtuple.hxx4
-rw-r--r--include/basegfx/tuple/b3dtuple.hxx6
2 files changed, 5 insertions, 5 deletions
diff --git a/include/basegfx/tuple/b2dtuple.hxx b/include/basegfx/tuple/b2dtuple.hxx
index 3819a5b1a24a..b6748a902118 100644
--- a/include/basegfx/tuple/b2dtuple.hxx
+++ b/include/basegfx/tuple/b2dtuple.hxx
@@ -254,8 +254,8 @@ namespace basegfx
inline B2DTuple average(const B2DTuple& rOld1, const B2DTuple& rOld2)
{
return B2DTuple(
- rOld1.getX() == rOld2.getX() ? rOld1.getX() : (rOld1.getX() + rOld2.getX()) * 0.5,
- rOld1.getY() == rOld2.getY() ? rOld1.getY() : (rOld1.getY() + rOld2.getY()) * 0.5);
+ rtl::math::approxEqual(rOld1.getX(), rOld2.getX()) ? rOld1.getX() : (rOld1.getX() + rOld2.getX()) * 0.5,
+ rtl::math::approxEqual(rOld1.getY(), rOld2.getY()) ? rOld1.getY() : (rOld1.getY() + rOld2.getY()) * 0.5);
}
inline B2DTuple operator+(const B2DTuple& rTupA, const B2DTuple& rTupB)
diff --git a/include/basegfx/tuple/b3dtuple.hxx b/include/basegfx/tuple/b3dtuple.hxx
index 842e3bcbd381..30b95beffc94 100644
--- a/include/basegfx/tuple/b3dtuple.hxx
+++ b/include/basegfx/tuple/b3dtuple.hxx
@@ -308,9 +308,9 @@ namespace basegfx
inline B3DTuple average(const B3DTuple& rOld1, const B3DTuple& rOld2)
{
return B3DTuple(
- rOld1.getX() == rOld2.getX() ? rOld1.getX() : (rOld1.getX() + rOld2.getX()) * 0.5,
- rOld1.getY() == rOld2.getY() ? rOld1.getY() : (rOld1.getY() + rOld2.getY()) * 0.5,
- rOld1.getZ() == rOld2.getZ() ? rOld1.getZ() : (rOld1.getZ() + rOld2.getZ()) * 0.5);
+ rtl::math::approxEqual(rOld1.getX(), rOld2.getX()) ? rOld1.getX() : (rOld1.getX() + rOld2.getX()) * 0.5,
+ rtl::math::approxEqual(rOld1.getY(), rOld2.getY()) ? rOld1.getY() : (rOld1.getY() + rOld2.getY()) * 0.5,
+ rtl::math::approxEqual(rOld1.getZ(), rOld2.getZ()) ? rOld1.getZ() : (rOld1.getZ() + rOld2.getZ()) * 0.5);
}
inline B3DTuple operator+(const B3DTuple& rTupA, const B3DTuple& rTupB)