Skip to content

Commit

Permalink
use qIsNaN instead of isnan (fixes windows build)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Oct 14, 2014
1 parent 65ac4fe commit b94b44a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgsvectorcolorrampv2.cpp
Expand Up @@ -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() ) );
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b94b44a

Please sign in to comment.