diff layer/TimeValueLayer.cpp @ 554:ffeafe09c8d9

* Add origin line (y=0) to time-value layer
author Chris Cannam
date Fri, 29 Jan 2010 13:54:25 +0000
parents 97e60a895211
children 5bcfc5606528
line wrap: on
line diff
--- a/layer/TimeValueLayer.cpp	Thu Jan 28 16:46:04 2010 +0000
+++ b/layer/TimeValueLayer.cpp	Fri Jan 29 13:54:25 2010 +0000
@@ -905,6 +905,14 @@
     int textY = 0;
     if (m_plotStyle == PlotSegmentation) {
         textY = v->getTextLabelHeight(this, paint);
+    } else {
+        int originY = getYForValue(v, 0.f);
+        if (originY > 0 && originY < v->height()) {
+            paint.save();
+            paint.setPen(getPartialShades(v)[1]);
+            paint.drawLine(x0, originY, x1, originY);
+            paint.restore();
+        }
     }
     
     for (SparseTimeValueModel::PointList::const_iterator i = points.begin();