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 @@ -400,14 +400,23 @@ void QgsSingleBandPseudoColorRendererWidget::on_mClassifyButton_clicked()
400
400
{
401
401
for ( int i = 0 ; i < numberOfEntries; ++i )
402
402
{
403
- double value = colorRamp->value ( i );
404
- entryValues.push_back ( min + value * ( max - min ) );
403
+ if ( mInvertCheckBox ->isChecked () )
404
+ {
405
+ double value = 1.0 - colorRamp->value ( numberOfEntries - i - 1 );
406
+ entryValues.push_back ( min + value * ( max - min ) );
407
+ }
408
+ else
409
+ {
410
+ double value = colorRamp->value ( i );
411
+ entryValues.push_back ( min + value * ( max - min ) );
412
+ }
405
413
}
406
414
}
407
415
// for continuous mode take original color map colors
408
416
for ( int i = 0 ; i < numberOfEntries; ++i )
409
417
{
410
- entryColors.push_back ( colorRamp->color ( colorRamp->value ( i ) ) );
418
+ int idx = mInvertCheckBox ->isChecked () ? numberOfEntries - i - 1 : i;
419
+ entryColors.push_back ( colorRamp->color ( colorRamp->value ( idx ) ) );
411
420
}
412
421
}
413
422
}
You can’t perform that action at this time.
0 commit comments