mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Fix incorrect values returned by certain color ramps
This commit is contained in:
parent
c31810af8b
commit
27ee8eea45
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user