Skip to content
Permalink
Browse files

Fix incorrect values returned by certain color ramps

  • Loading branch information
nyalldawson committed Aug 4, 2015
1 parent c31810a commit 27ee8eea45f4b7db9631980c2218598ca7edab05
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/symbology-ng/qgsvectorcolorrampv2.cpp
@@ -291,7 +291,7 @@ QgsVectorColorRampV2* QgsVectorRandomColorRampV2::create( const QgsStringMap& pr
double QgsVectorRandomColorRampV2::value( int index ) const
{
if ( mColors.size() < 1 ) return 0;
return index / mColors.size() - 1;
return ( double )index / ( mColors.size() - 1 );
}

QColor QgsVectorRandomColorRampV2::color( double value ) const
@@ -489,7 +489,7 @@ QList<int> QgsVectorColorBrewerColorRampV2::listSchemeVariants( QString schemeNa
double QgsVectorColorBrewerColorRampV2::value( int index ) const
{
if ( mPalette.size() < 1 ) return 0;
return index / mPalette.size() - 1;
return ( double )index / ( mPalette.size() - 1 );
}

QColor QgsVectorColorBrewerColorRampV2::color( double value ) const

0 comments on commit 27ee8ee

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