Commit eb3cee1 1 parent 5d3382a commit eb3cee1 Copy full SHA for eb3cee1
File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -291,7 +291,7 @@ QgsVectorColorRampV2* QgsVectorRandomColorRampV2::create( const QgsStringMap& pr
291
291
double QgsVectorRandomColorRampV2::value ( int index ) const
292
292
{
293
293
if ( mColors .size () < 1 ) return 0 ;
294
- return index / mColors .size () - 1 ;
294
+ return ( double ) index / ( mColors .size () - 1 ) ;
295
295
}
296
296
297
297
QColor QgsVectorRandomColorRampV2::color ( double value ) const
@@ -489,7 +489,7 @@ QList<int> QgsVectorColorBrewerColorRampV2::listSchemeVariants( QString schemeNa
489
489
double QgsVectorColorBrewerColorRampV2::value ( int index ) const
490
490
{
491
491
if ( mPalette .size () < 1 ) return 0 ;
492
- return index / mPalette .size () - 1 ;
492
+ return ( double ) index / ( mPalette .size () - 1 ) ;
493
493
}
494
494
495
495
QColor QgsVectorColorBrewerColorRampV2::color ( double value ) const
You can’t perform that action at this time.
0 commit comments