namespace pv {
namespace view {
+const QPen Trace::AxisPen(QColor(128, 128, 128, 64));
const int Trace::LabelHitPadding = 2;
Trace::Trace(pv::SigSession &session, QString name) :
_view = view;
}
+void Trace::paint_back(QPainter &p, int left, int right)
+{
+ (void)p;
+ (void)left;
+ (void)right;
+}
+
+void Trace::paint_mid(QPainter &p, int left, int right)
+{
+ (void)p;
+ (void)left;
+ (void)right;
+}
+
+void Trace::paint_fore(QPainter &p, int left, int right)
+{
+ (void)p;
+ (void)left;
+ (void)right;
+}
+
void Trace::paint_label(QPainter &p, int right, bool hover)
{
assert(_view);
p.drawPolygon(points, countof(points));
// Paint the text
- p.setPen((colour.lightness() > 64) ? Qt::black : Qt::white);
+ p.setPen(get_text_colour());
p.drawText(label_rect, Qt::AlignCenter | Qt::AlignVCenter, _name);
}
).contains(point);
}
+int Trace::get_y() const
+{
+ return _v_offset - _view->v_offset();
+}
+
+QColor Trace::get_text_colour() const
+{
+ return (_colour.lightness() > 64) ? Qt::black : Qt::white;
+}
+
+void Trace::paint_axis(QPainter &p, int y, int left, int right)
+{
+ p.setPen(AxisPen);
+ p.drawLine(QPointF(left, y + 0.5f), QPointF(right, y + 0.5f));
+}
+
void Trace::compute_text_size(QPainter &p)
{
_text_size = QSize(