changeset 375:daaf1c435d98

* Fix mislabelling of time lines in ruler
author Chris Cannam
date Wed, 12 Mar 2008 14:40:18 +0000
parents 67f82da3d29c
children e1a9e478b7f2
files layer/TimeRulerLayer.cpp
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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();