# HG changeset patch # User Chris Cannam # Date 1264773265 0 # Node ID ffeafe09c8d9fc46f87bc76f89063a01d3c21d2e # Parent 97e60a8952111a5e4df27d95cb850fff2f0fd7bb * Add origin line (y=0) to time-value layer diff -r 97e60a895211 -r ffeafe09c8d9 layer/TimeValueLayer.cpp --- 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();