Skip to content
Permalink
Browse files

use qIsNaN to test for NaNs

  • Loading branch information
jef-n committed Jan 25, 2014
1 parent 6b1bc02 commit b399c1e1d1fdd28e29e5f169f704660f624b6552
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/raster/qgsrastertransparency.cpp
@@ -104,7 +104,7 @@ void QgsRasterTransparency::setTransparentThreeValuePixelList( QList<QgsRasterTr
int QgsRasterTransparency::alphaValue( double theValue, int theGlobalTransparency ) const
{
//if NaN return 0, transparent
if ( theValue != theValue )
if ( qIsNaN(theValue) )
{
return 0;
}
@@ -144,7 +144,7 @@ int QgsRasterTransparency::alphaValue( double theValue, int theGlobalTransparenc
int QgsRasterTransparency::alphaValue( double theRedValue, double theGreenValue, double theBlueValue, int theGlobalTransparency ) const
{
//if NaN return 0, transparent
if ( theRedValue != theRedValue || theGreenValue != theGreenValue || theBlueValue != theBlueValue )
if ( qIsNaN(theRedValue) || qIsNaN(theGreenValue) || qIsNaN(theBlueValue) )
{
return 0;
}

0 comments on commit b399c1e

Please sign in to comment.