File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -369,14 +369,23 @@ void QgsSingleBandPseudoColorRendererWidget::on_mClassifyButton_clicked()
369369 {
370370 for ( int i = 0 ; i < numberOfEntries; ++i )
371371 {
372- double value = colorRamp->value ( i );
373- entryValues.push_back ( min + value * ( max - min ) );
372+ if ( mInvertCheckBox ->isChecked () )
373+ {
374+ double value = 1.0 - colorRamp->value ( numberOfEntries - i - 1 );
375+ entryValues.push_back ( min + value * ( max - min ) );
376+ }
377+ else
378+ {
379+ double value = colorRamp->value ( i );
380+ entryValues.push_back ( min + value * ( max - min ) );
381+ }
374382 }
375383 }
376384 // for continuous mode take original color map colors
377385 for ( int i = 0 ; i < numberOfEntries; ++i )
378386 {
379- entryColors.push_back ( colorRamp->color ( colorRamp->value ( i ) ) );
387+ int idx = mInvertCheckBox ->isChecked () ? numberOfEntries - i - 1 : i;
388+ entryColors.push_back ( colorRamp->color ( colorRamp->value ( idx ) ) );
380389 }
381390 }
382391 }
You can’t perform that action at this time.
0 commit comments