X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fruler.cpp;h=83863e61ea203e3a3efb08f772425a8510da029d;hp=c5f194f2f76f4011009107659c2ad70790605e6f;hb=f76af6375b8aea6b7edb2d6ee838e1589c3490f3;hpb=e2f5223b74da179688de92146a2716209b42bdb0;ds=sidebyside diff --git a/pv/view/ruler.cpp b/pv/view/ruler.cpp index c5f194f2..83863e61 100644 --- a/pv/view/ruler.cpp +++ b/pv/view/ruler.cpp @@ -31,6 +31,8 @@ #include #include +using namespace std; + namespace pv { namespace view { @@ -123,12 +125,26 @@ void Ruler::paintEvent(QPaintEvent *event) division++; } + // Draw the cursors + draw_cursors(p); + // Draw the hover mark draw_hover_mark(p); p.end(); } +void Ruler::draw_cursors(QPainter &p) +{ + if(!_view.cursors_shown()) + return; + + const QRect r = rect(); + pair &cursors = _view.cursors(); + cursors.first.paint_label(p, r); + cursors.second.paint_label(p, r); +} + void Ruler::draw_hover_mark(QPainter &p) { const int x = _view.hover_point().x();