Skip to content
Permalink
Browse files

Also handle WhiteToBlack case in QgsSingleBandGrayRenderer::legendSym…

…bologyItems
  • Loading branch information
manisandro authored and nyalldawson committed Feb 16, 2015
1 parent f6a1b7e commit a0e2fe1f9928b82f19694d94b8f88b66cf8b95ff
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/core/raster/qgssinglebandgrayrenderer.cpp
@@ -213,8 +213,10 @@ void QgsSingleBandGrayRenderer::legendSymbologyItems( QList< QPair< QString, QCo
{
if ( mContrastEnhancement && mContrastEnhancement->contrastEnhancementAlgorithm() != QgsContrastEnhancement::NoEnhancement )
{
symbolItems.push_back( qMakePair( QString::number( mContrastEnhancement->minimumValue() ), QColor( 0, 0, 0 ) ) );
symbolItems.push_back( qMakePair( QString::number( mContrastEnhancement->maximumValue() ), QColor( 255, 255, 255 ) ) );
QColor minColor = ( mGradient == BlackToWhite ) ? Qt::black : Qt::white;
QColor maxColor = ( mGradient == BlackToWhite ) ? Qt::white : Qt::black;
symbolItems.push_back( qMakePair( QString::number( mContrastEnhancement->minimumValue() ), minColor ) );
symbolItems.push_back( qMakePair( QString::number( mContrastEnhancement->maximumValue() ), maxColor ) );
}
}

0 comments on commit a0e2fe1

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