diff layer/LinearNumericalScale.cpp @ 904:e0f08e108064 cxx11

Move to using double rather than float for floating-point calculations (float only for storage); more build fixes
author Chris Cannam
date Mon, 09 Mar 2015 12:02:10 +0000
parents 3ca3b8fbbcee
children b66fb15de477
line wrap: on
line diff
--- a/layer/LinearNumericalScale.cpp	Mon Mar 09 08:43:20 2015 +0000
+++ b/layer/LinearNumericalScale.cpp	Mon Mar 09 12:02:10 2015 +0000
@@ -34,20 +34,20 @@
 				    const VerticalScaleLayer *layer,
 				    QPainter &paint,
 				    int x0,
-				    float minf,
-				    float maxf)
+				    double minf,
+				    double maxf)
 {
     int n = 10;
 
-    float val = minf;
-    float inc = (maxf - val) / n;
+    double val = minf;
+    double inc = (maxf - val) / n;
 
     const int buflen = 40;
     char buffer[buflen];
 
     int w = getWidth(v, paint) + x0;
 
-    float round = 1.f;
+    double round = 1.f;
     int dp = 0;
     if (inc > 0) {
         int prec = trunc(log10f(inc));
@@ -66,7 +66,7 @@
 	int y, ty;
         bool drawText = true;
 
-        float dispval = val;
+        double dispval = val;
 
 	if (i == n-1 &&
 	    v->height() < paint.fontMetrics().height() * (n*2)) {