# HG changeset patch # User Chris Cannam # Date 1205332818 0 # Node ID daaf1c435d980a193877d0c2dd13e49e85b4331c # Parent 67f82da3d29c60d6e756d33415fce848c657af07 * Fix mislabelling of time lines in ruler diff -r 67f82da3d29c -r daaf1c435d98 layer/TimeRulerLayer.cpp --- a/layer/TimeRulerLayer.cpp Fri Feb 15 15:35:56 2008 +0000 +++ b/layer/TimeRulerLayer.cpp Wed Mar 12 14:40:18 2008 +0000 @@ -249,8 +249,6 @@ frame /= v->getZoomLevel(); frame *= v->getZoomLevel(); // so frame corresponds to an exact pixel - ms += incms; - int x = v->getXForFrame(frame); #ifdef DEBUG_TIME_RULER_LAYER @@ -266,12 +264,12 @@ if (x >= rect.x() - 50) { + RealTime rt = RealTime::fromMilliseconds(ms); + #ifdef DEBUG_TIME_RULER_LAYER - std::cerr << "X in range, drawing line here" << std::endl; + std::cerr << "X in range, drawing line here for time " << rt.toText() << std::endl; #endif - RealTime rt = RealTime::fromMilliseconds(ms); - QString text(QString::fromStdString(rt.toText())); QFontMetrics metrics = paint.fontMetrics(); int tw = metrics.width(text); @@ -351,6 +349,8 @@ paint.drawLine(x, 0, x, sz); paint.drawLine(x, v->height() - sz - 1, x, v->height() - 1); } + + ms += incms; } paint.restore();