Skip to content
Permalink
Browse files

Follow up 27abd20

  • Loading branch information
nyalldawson committed Sep 26, 2014
1 parent a8ba123 commit 4de0d8344bc0634123ea8022925498e96f642793
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp
@@ -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;

0 comments on commit 4de0d83

Please sign in to comment.
You can’t perform that action at this time.