diff layer/Colour3DPlotLayer.cpp @ 456:035d62c4cddf

* Permit viewing (though not editing) colour 3d plot layer data in the spreadsheet data viewer dialog * Add somewhat simplistic RDF export for layers * Fix display of peak frequencies in spectrum layer * Fix (I hope) sizing of plugin parameter dialog
author Chris Cannam
date Tue, 02 Dec 2008 17:17:25 +0000
parents 84ada1c89510
children e75f15c9ea11
line wrap: on
line diff
--- a/layer/Colour3DPlotLayer.cpp	Mon Dec 01 16:45:17 2008 +0000
+++ b/layer/Colour3DPlotLayer.cpp	Tue Dec 02 17:17:25 2008 +0000
@@ -553,12 +553,20 @@
     if (symin < 0) symin = 0;
     if (symax > sh) symax = sh;
 
+    float binHeight = float(v->height()) / (symax - symin);
+
+    paint.save();
+
+    QFont tf = paint.font();
+    if (paint.fontMetrics().height() >= binHeight) {
+        tf.setPixelSize(binHeight > 4 ? binHeight - 2 : 2);
+        paint.setFont(tf);
+    }
+
     int count = v->height() / paint.fontMetrics().height();
     int step = (symax - symin) / count;
     if (step == 0) step = 1;
 
-    float binHeight = float(v->height()) / (symax - symin);
-
     for (size_t i = symin; i < symax; ++i) {
 
         size_t idx = i;
@@ -578,6 +586,8 @@
 
 	paint.drawText(cw + 5, ty, text);
     }
+
+    paint.restore();
 }
 
 void