mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
fix colors for continuous classification with non equally spaced stops
This commit is contained in:
parent
912f06da34
commit
589364746a
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user