Skip to content
Permalink
Browse files

use qIsNaN instead of isnan (fixes windows build)

  • Loading branch information
jef-n committed Oct 14, 2014
1 parent 65ac4fe commit b94b44af8f904bde411e0dee563f1bdfd180cc2f
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/symbology-ng/qgsvectorcolorrampv2.cpp
@@ -30,7 +30,7 @@

static QColor _interpolate( QColor c1, QColor c2, double value )
{
if ( isnan( value ) ) value = 1;
if ( qIsNaN(value) ) value = 1;
int r = ( int )( c1.red() + value * ( c2.red() - c1.red() ) );
int g = ( int )( c1.green() + value * ( c2.green() - c1.green() ) );
int b = ( int )( c1.blue() + value * ( c2.blue() - c1.blue() ) );
@@ -370,7 +370,7 @@ QColor QgsRandomColorsV2::color( double value ) const
int maxVal = 255;

//if value is nan, then use last precalculated color
int colorIndex = ( !isnan( value ) ? value : 1 ) * ( mTotalColorCount - 1 );
int colorIndex = ( !qIsNaN( value ) ? value : 1 ) * ( mTotalColorCount - 1 );
if ( mTotalColorCount >= 1 && mPrecalculatedColors.length() > colorIndex )
{
//use precalculated hue

0 comments on commit b94b44a

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