Mercurial > hg > svgui
comparison layer/TimeRulerLayer.cpp @ 1342:ed6400d5b571 zoom
Fix stupidity
author | Chris Cannam |
---|---|
date | Thu, 27 Sep 2018 15:54:02 +0100 |
parents | ab2cafd3a7cb |
children | 3fa8cdbf362c |
comparison
equal
deleted
inserted
replaced
1341:ab2cafd3a7cb | 1342:ed6400d5b571 |
---|---|
28 | 28 |
29 #include <iostream> | 29 #include <iostream> |
30 #include <cmath> | 30 #include <cmath> |
31 #include <stdexcept> | 31 #include <stdexcept> |
32 | 32 |
33 //#define DEBUG_TIME_RULER_LAYER 1 | 33 #define DEBUG_TIME_RULER_LAYER 1 |
34 | 34 |
35 | 35 |
36 TimeRulerLayer::TimeRulerLayer() : | 36 TimeRulerLayer::TimeRulerLayer() : |
37 SingleColourLayer(), | 37 SingleColourLayer(), |
38 m_model(0), | 38 m_model(0), |
302 break; | 302 break; |
303 } | 303 } |
304 | 304 |
305 if (x >= rect.x() - 50 && us >= minlabel) { | 305 if (x >= rect.x() - 50 && us >= minlabel) { |
306 | 306 |
307 RealTime rt = RealTime(0, us * 1000); | 307 RealTime rt = RealTime::fromMicroseconds(us); |
308 | 308 |
309 #ifdef DEBUG_TIME_RULER_LAYER | 309 #ifdef DEBUG_TIME_RULER_LAYER |
310 cerr << "X in range, drawing line here for time " << rt.toText() << endl; | 310 cerr << "X in range, drawing line here for time " << rt.toText() << " (usec = " << us << ")" << endl; |
311 #endif | 311 #endif |
312 | 312 |
313 QString text(QString::fromStdString(rt.toText())); | 313 QString text(QString::fromStdString(rt.toText())); |
314 QFontMetrics metrics = paint.fontMetrics(); | 314 QFontMetrics metrics = paint.fontMetrics(); |
315 int tw = metrics.width(text); | 315 int tw = metrics.width(text); |