Skip to content

Commit

Permalink
Fix calculation of random colors following 4d72d72
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 13, 2014
1 parent 083ebfe commit 08d8016
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/symbology-ng/qgsvectorcolorrampv2.cpp
Expand Up @@ -369,7 +369,8 @@ QColor QgsRandomColorsV2::color( double value ) const
int minVal = 130;
int maxVal = 255;

int colorIndex = !isnan( value ) ? value : 1 * ( mTotalColorCount - 1 );
//if value is nan, then use last precalculated color
int colorIndex = ( !isnan( value ) ? value : 1 ) * ( mTotalColorCount - 1 );
if ( mTotalColorCount >= 1 && mPrecalculatedColors.length() > colorIndex )
{
//use precalculated hue
Expand Down

1 comment on commit 08d8016

@nyalldawson
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops - this commit message should have read "following 083ebfe"

Please sign in to comment.