# HG changeset patch # User Chris Cannam # Date 1390921329 0 # Node ID e5f4385615ac87c8cc9d93fd453b0f91add6a486 # Parent b81f21f2c4c3d1cb115e278a098ac4869fb7377f# Parent 137d3ff48f73b9a6bac722491e8628f1721b8f3d Merge from tonioni branch diff -r 137d3ff48f73 -r e5f4385615ac layer/LogNumericalScale.cpp --- a/layer/LogNumericalScale.cpp Fri Jan 10 14:41:38 2014 +0000 +++ b/layer/LogNumericalScale.cpp Tue Jan 28 15:02:09 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);