Skip to content

Commit 08d8016

Browse files
committedOct 13, 2014
Fix calculation of random colors following 4d72d72
1 parent 083ebfe commit 08d8016

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/core/symbology-ng/qgsvectorcolorrampv2.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@ QColor QgsRandomColorsV2::color( double value ) const
369369
int minVal = 130;
370370
int maxVal = 255;
371371

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

1 commit comments

Comments
 (1)

nyalldawson commented on Oct 13, 2014

@nyalldawson
CollaboratorAuthor

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

Please sign in to comment.