Skip to content

Commit e260cc1

Browse files
author
g_j_m
committedOct 22, 2006
Partial fix for ticket #303 (tiff withs nulls in them plot all
black). More to come. git-svn-id: http://svn.osgeo.org/qgis/trunk@5998 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 9c91bce commit e260cc1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎src/raster/qgsrasterlayer.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,12 @@ void QgsRasterLayer::drawSingleBandGray(QPainter * theQPainter, QgsRasterViewPor
15391539
double myGrayValDouble = readValue ( myGdalScanData, myDataType,
15401540
myColumnInt * theRasterViewPort->drawableAreaXDimInt + myRowInt );
15411541

1542-
if ( myGrayValDouble == noDataValueDouble )
1542+
// If noDataValueDouble is 'nan', the comparison
1543+
// against myGrayValDouble will always fail ( nan==nan always
1544+
// returns false, by design), hence the slightly odd comparison
1545+
// of myGrayValDouble against itself.
1546+
if ( myGrayValDouble == noDataValueDouble ||
1547+
myGrayValDouble != myGrayValDouble)
15431548
{
15441549

15451550
myQImage.setPixel(myRowInt, myColumnInt, qRgba(255,255,255,0 ));

0 commit comments

Comments
 (0)
Please sign in to comment.