Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Follow up 27abd20
  • Loading branch information
nyalldawson committed Sep 26, 2014
1 parent a8ba123 commit 4de0d83
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp
Expand Up @@ -712,6 +712,15 @@ void QgsCategorizedSymbolRendererV2::updateColorRamp( QgsVectorColorRampV2* ramp
setInvertedColorRamp( inverted );
double num = mCategories.count() - 1;
double count = 0;

QgsRandomColorsV2* randomRamp = dynamic_cast<QgsRandomColorsV2*>( ramp );
if ( randomRamp )
{
//ramp is a random colors ramp, so inform it of the total number of required colors
//this allows the ramp to pregenerate a set of visually distinctive colors
randomRamp->setTotalColorCount( mCategories.count() );
}

foreach ( const QgsRendererCategoryV2 &cat, mCategories )
{
double value = count / num;
Expand Down

0 comments on commit 4de0d83

Please sign in to comment.