Skip to content

Commit

Permalink
Fix random color ramps returning invalid QColors for value of 1.0
Browse files Browse the repository at this point in the history
(cherry-picked from 1d2b4cb)
  • Loading branch information
nyalldawson committed Aug 4, 2015
1 parent fd394b9 commit 1874c37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgsvectorcolorrampv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,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 1874c37

Please sign in to comment.