Skip to content
Permalink
Browse files
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/qgis@5998 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Oct 22, 2006
1 parent d6492dc commit 485ab82efbc8240460c2460340a1abc391984356
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/raster/qgsrasterlayer.cpp
@@ -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 ));

0 comments on commit 485ab82

Please sign in to comment.