Skip to content

Commit

Permalink
Partial fix for ticket #303 (tiff withs nulls in them plot all
Browse files Browse the repository at this point in the history
black). More to come.


git-svn-id: http://svn.osgeo.org/qgis/trunk@5998 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Oct 22, 2006
1 parent 9c91bce commit e260cc1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/raster/qgsrasterlayer.cpp
Expand Up @@ -1539,7 +1539,12 @@ void QgsRasterLayer::drawSingleBandGray(QPainter * theQPainter, QgsRasterViewPor
double myGrayValDouble = readValue ( myGdalScanData, myDataType,
myColumnInt * theRasterViewPort->drawableAreaXDimInt + myRowInt );

if ( myGrayValDouble == noDataValueDouble )
// If noDataValueDouble is 'nan', the comparison
// against myGrayValDouble will always fail ( nan==nan always
// returns false, by design), hence the slightly odd comparison
// of myGrayValDouble against itself.
if ( myGrayValDouble == noDataValueDouble ||
myGrayValDouble != myGrayValDouble)
{

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

0 comments on commit e260cc1

Please sign in to comment.