Skip to content

Commit b399c1e

Browse files
committedJan 25, 2014
use qIsNaN to test for NaNs
1 parent 6b1bc02 commit b399c1e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/core/raster/qgsrastertransparency.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void QgsRasterTransparency::setTransparentThreeValuePixelList( QList<QgsRasterTr
104104
int QgsRasterTransparency::alphaValue( double theValue, int theGlobalTransparency ) const
105105
{
106106
//if NaN return 0, transparent
107-
if ( theValue != theValue )
107+
if ( qIsNaN(theValue) )
108108
{
109109
return 0;
110110
}
@@ -144,7 +144,7 @@ int QgsRasterTransparency::alphaValue( double theValue, int theGlobalTransparenc
144144
int QgsRasterTransparency::alphaValue( double theRedValue, double theGreenValue, double theBlueValue, int theGlobalTransparency ) const
145145
{
146146
//if NaN return 0, transparent
147-
if ( theRedValue != theRedValue || theGreenValue != theGreenValue || theBlueValue != theBlueValue )
147+
if ( qIsNaN(theRedValue) || qIsNaN(theGreenValue) || qIsNaN(theBlueValue) )
148148
{
149149
return 0;
150150
}

0 commit comments

Comments
 (0)
Please sign in to comment.