changeset 718:e5f4385615ac tony_integration

Merge from tonioni branch
author Chris Cannam
date Tue, 28 Jan 2014 15:02:09 +0000
parents b81f21f2c4c3 (diff) 137d3ff48f73 (current diff)
children a352fb986e7b
files layer/layer.pro view/view.pro widgets/widgets.pro
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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);