Skip to content

Commit

Permalink
Bugfix by Radim: prevent extra multiplication if alpha is 1
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jun 26, 2012
1 parent 10ad3fb commit 8304d6a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/raster/qgsmultibandcolorrenderer.cpp
Expand Up @@ -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 );
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/raster/qgssinglebandgrayrenderer.cpp
Expand Up @@ -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 );
}
Expand Down

0 comments on commit 8304d6a

Please sign in to comment.