Skip to content
Permalink
Browse files

Bugfix by Radim: prevent extra multiplication if alpha is 1

  • Loading branch information
mhugent committed Jun 26, 2012
1 parent 10ad3fb commit 8304d6a3b772dee069fb49260a40c868b82521dc
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/core/raster/qgsmultibandcolorrenderer.cpp
  2. +1 −1 src/core/raster/qgssinglebandgrayrenderer.cpp
@@ -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 );
}
@@ -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 );
}

0 comments on commit 8304d6a

Please sign in to comment.
You can’t perform that action at this time.