summaryrefslogtreecommitdiff
path: root/basegfx/source/color/bcolortools.cxx
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/color/bcolortools.cxx
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/color/bcolortools.cxx')
-rw-r--r--basegfx/source/color/bcolortools.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/basegfx/source/color/bcolortools.cxx b/basegfx/source/color/bcolortools.cxx
index 293deb836517..7e139ac83263 100644
--- a/basegfx/source/color/bcolortools.cxx
+++ b/basegfx/source/color/bcolortools.cxx
@@ -43,9 +43,9 @@ namespace basegfx { namespace tools
s = l > 0.5 ? d/(2.0-maxVal-minVal) :
d/(maxVal + minVal);
- if( r == maxVal )
+ if( rtl::math::approxEqual(r, maxVal) )
h = (g - b)/d;
- else if( g == maxVal )
+ else if( rtl::math::approxEqual(g, maxVal) )
h = 2.0 + (b - r)/d;
else
h = 4.0 + (r - g)/d;
@@ -117,11 +117,11 @@ namespace basegfx { namespace tools
if( !fTools::equalZero(s) )
{
- if( maxVal == r )
+ if( rtl::math::approxEqual(maxVal, r) )
{
h = (g - b) / delta;
}
- else if( maxVal == g )
+ else if( rtl::math::approxEqual(maxVal, g) )
{
h = 2.0 + (b - r) / delta;
}