Bugfix by Radim: prevent extra multiplication if alpha is 1

This commit is contained in:
Marco Hugentobler 2012-06-26 22:23:51 +02:00
parent 10ad3fb072
commit 8304d6a3b7
2 changed files with 2 additions and 2 deletions

View File

@ -295,7 +295,7 @@ void QgsMultiBandColorRenderer::draw( QPainter* p, QgsRasterViewPort* viewPort,
currentOpacity *= ( readValue( alphaData, transparencyType, currentRasterPos ) / 255.0 );
}
if ( doubleNear( currentOpacity, 255 ) )
if ( doubleNear( currentOpacity, 1.0 ) )
{
imageScanLine[j] = qRgba( redVal, greenVal, blueVal, 255 );
}

View File

@ -149,7 +149,7 @@ void QgsSingleBandGrayRenderer::draw( QPainter* p, QgsRasterViewPort* viewPort,
grayVal = 255 - grayVal;
}
if ( doubleNear( currentAlpha, 255 ) )
if ( doubleNear( currentAlpha, 1.0 ) )
{
imageScanLine[j] = qRgba( grayVal, grayVal, grayVal, 255 );
}