Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
replace pow10 with qPow (fixes #12717)
  • Loading branch information
jef-n committed May 7, 2015
1 parent 656af53 commit 2c38552
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/composer/qgscomposerscalebar.cpp
Expand Up @@ -226,14 +226,14 @@ void QgsComposerScaleBar::invalidateCurrentMap()
// nextNiceNumber(4573.23, d) = 5000 (d=1) -> 4600 (d=10) -> 4580 (d=100) -> 4574 (d=1000) -> etc
inline double nextNiceNumber( double a, double d = 1 )
{
double s = pow10( floor( log10( a ) ) ) / d;
double s = qPow( 10.0, floor( log10( a ) ) ) / d;
return ceil( a / s ) * s;
}

// prevNiceNumber(4573.23, d) = 4000 (d=1) -> 4500 (d=10) -> 4570 (d=100) -> 4573 (d=1000) -> etc
inline double prevNiceNumber( double a, double d = 1 )
{
double s = pow10( floor( log10( a ) ) ) / d;
double s = qPow( 10.0, floor( log10( a ) ) ) / d;
return floor( a / s ) * s;
}

Expand Down Expand Up @@ -455,7 +455,7 @@ void QgsComposerScaleBar::applyDefaultSize( QgsComposerScaleBar::ScaleBarUnits u

double segmentWidth = initialUnitsPerSegment / upperMagnitudeMultiplier;
int segmentMagnitude = floor( log10( segmentWidth ) );
double unitsPerSegment = upperMagnitudeMultiplier * ( pow( 10.0, segmentMagnitude ) );
double unitsPerSegment = upperMagnitudeMultiplier * ( qPow( 10.0, segmentMagnitude ) );
double multiplier = floor(( widthInSelectedUnits / ( unitsPerSegment * 10.0 ) ) / 2.5 ) * 2.5;

if ( multiplier > 0 )
Expand Down

0 comments on commit 2c38552

Please sign in to comment.