Mercurial > hg > svgui
diff layer/LogNumericalScale.cpp @ 720:5f9c0147d1d6 tonioni
Merge from default branch
author | Chris Cannam |
---|---|
date | Tue, 28 Jan 2014 18:33:44 +0000 |
parents | b81f21f2c4c3 |
children | 3ca3b8fbbcee |
line wrap: on
line diff
--- a/layer/LogNumericalScale.cpp Fri Jan 10 14:41:38 2014 +0000 +++ b/layer/LogNumericalScale.cpp Tue Jan 28 18:33:44 2014 +0000 @@ -64,6 +64,7 @@ int prec = trunc(log10f(minDispInc)); if (prec < 0) dp = -prec; round = powf(10.f, prec); + if (dp > 4) dp = 4; #ifdef DEBUG_TIME_VALUE_LAYER cerr << "round = " << round << ", prec = " << prec << ", dp = " << dp << endl; #endif @@ -97,11 +98,13 @@ continue; } - double dv = dispval; - int digits = trunc(log10f(dv)); + int digits = trunc(log10f(dispval)); int sf = dp + (digits > 0 ? digits : 0); if (sf < 4) sf = 4; - sprintf(buffer, "%.*g", sf, dv); +#ifdef DEBUG_TIME_VALUE_LAYER + cerr << "sf = " << sf << endl; +#endif + sprintf(buffer, "%.*g", sf, dispval); QString label = QString(buffer);