fix colors for continuous classification with non equally spaced stops

This commit is contained in:
Piers Titus van der Torren 2016-04-13 14:25:42 +02:00 committed by Nyall Dawson
parent 912f06da34
commit 589364746a

View File

@ -383,12 +383,19 @@ void QgsSingleBandPseudoColorRendererWidget::on_mClassifyButton_clicked()
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 ) ) );
}
}
else if ( mClassificationModeComboBox->itemData( mClassificationModeComboBox->currentIndex() ).toInt() == Quantile )
{ // Quantile
}
else // for other classification modes interpolate colors linearly
{
numberOfEntries = mNumberOfEntriesSpinBox->value();
if ( mClassificationModeComboBox->itemData( mClassificationModeComboBox->currentIndex() ).toInt() == Quantile )
{ // Quantile
int bandNr = mBandComboBox->itemData( bandComboIndex ).toInt();
//QgsRasterHistogram rasterHistogram = mRasterLayer->dataProvider()->histogram( bandNr );
@ -433,8 +440,6 @@ void QgsSingleBandPseudoColorRendererWidget::on_mClassifyButton_clicked()
}
else // EqualInterval
{
numberOfEntries = mNumberOfEntriesSpinBox->value();
if ( numberOfEntries > 1 )
{
entryValues.reserve( numberOfEntries );
@ -502,6 +507,7 @@ void QgsSingleBandPseudoColorRendererWidget::on_mClassifyButton_clicked()
entryColors.push_back( colorRamp->color((( double ) idx ) / ( numberOfEntries - 1 ) ) );
}
}
}
mColormapTreeWidget->clear();