Skip to content
Permalink
Browse files

[pseudocolor renderer] fix invert check box in continous mode

(fixes #15209)

(cherry-picked from 1e0e9c2)
  • Loading branch information
nirvn authored and nyalldawson committed Jul 4, 2016
1 parent 7c4aa12 commit 08bfd9155b1fa0d78e807aa18b8fd1c23ea7068f
Showing with 12 additions and 3 deletions.
  1. +12 −3 src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp
@@ -400,14 +400,23 @@ void QgsSingleBandPseudoColorRendererWidget::on_mClassifyButton_clicked()
{
for ( int i = 0; i < numberOfEntries; ++i )
{
double value = colorRamp->value( i );
entryValues.push_back( min + value * ( max - min ) );
if ( mInvertCheckBox->isChecked() )
{
double value = 1.0 - colorRamp->value( numberOfEntries - i - 1 );
entryValues.push_back( min + value * ( max - min ) );
}
else
{
double value = colorRamp->value( i );
entryValues.push_back( min + value * ( max - min ) );
}
}
}
// for continuous mode take original color map colors
for ( int i = 0; i < numberOfEntries; ++i )
{
entryColors.push_back( colorRamp->color( colorRamp->value( i ) ) );
int idx = mInvertCheckBox->isChecked() ? numberOfEntries - i - 1 : i;
entryColors.push_back( colorRamp->color( colorRamp->value( idx ) ) );
}
}
}

0 comments on commit 08bfd91

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