Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix random color ramps returning invalid QColors for value of 1.0
(cherry-picked from 1d2b4cb)
  • Loading branch information
nyalldawson committed Aug 4, 2015
1 parent 6a88720 commit 3bcc2bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgsvectorcolorrampv2.cpp
Expand Up @@ -297,7 +297,7 @@ double QgsVectorRandomColorRampV2::value( int index ) const
QColor QgsVectorRandomColorRampV2::color( double value ) const
{
int colorCnt = mColors.count();
int colorIdx = ( int )( value * colorCnt );
int colorIdx = ( int )( value * ( colorCnt - 1 ) );

if ( colorIdx >= 0 && colorIdx < colorCnt )
return mColors.at( colorIdx );
Expand Down

0 comments on commit 3bcc2bc

Please sign in to comment.