diff view/View.cpp @ 274:b9380f679f70

* Fix centre line position * Fix failure to update overview when generating peaks from wav file * Provide y-coordinate scale values and differences for spectrum measurement mode, and fix values for waveform (inc dB for both) * Add Printer colour scheme (may be futile)
author Chris Cannam
date Mon, 02 Jul 2007 13:04:17 +0000
parents 87e4c880b4c8
children a078aa2932cc
line wrap: on
line diff
--- a/view/View.cpp	Fri Jun 29 16:50:59 2007 +0000
+++ b/view/View.cpp	Mon Jul 02 13:04:17 2007 +0000
@@ -1726,9 +1726,18 @@
             bw = std::max(bw, paint.fontMetrics().width(bys));
         }
     }
-    
-    if (b0 && b1 && u0 == u1) {
-        dys = QString("(%1 %2)").arg(fabs(v1 - v0)).arg(u1);
+
+    bool bd = false;
+    float dy = 0.f;
+    QString du;
+
+    if ((bd = topLayer->getYScaleDifference(this, r.y(), r.y() + r.height(),
+                                            dy, du))) {
+        if (du != "") {
+            dys = QString("(%1 %2)").arg(dy).arg(du);
+        } else {
+            dys = QString("(%1)").arg(dy);
+        }
         dw = std::max(dw, paint.fontMetrics().width(dys));
     }