Skip to content
Permalink
Browse files

Fix incorrect values returned by certain color ramps

(cherry-picked from 27ee8ee)
  • Loading branch information
nyalldawson committed Aug 4, 2015
1 parent 5d3382a commit eb3cee1bf3cd2abcba989faf5e98ce42ea252707
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 eb3cee1

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