X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fruler.cpp;h=0322af8a611e1ad9520b854e2cbae0b7ec39ad81;hp=9e639383942ed1149702f9e369b16452a46eba1f;hb=b42d25c43e52c900cbdd3e5cde0282961b8721e7;hpb=140181a46034cf65739ba4bf0bf1260ab94ac736 diff --git a/pv/view/ruler.cpp b/pv/view/ruler.cpp index 9e63938..0322af8 100644 --- a/pv/view/ruler.cpp +++ b/pv/view/ruler.cpp @@ -186,14 +186,13 @@ void Ruler::mousePressEvent(QMouseEvent *e) _grabbed_marker = NULL; if (_view.cursors_shown()) { - std::pair &cursors = - _view.cursors(); - if (cursors.first.get_label_rect( + CursorPair &cursors = _view.cursors(); + if (cursors.first().get_label_rect( rect()).contains(e->pos())) - _grabbed_marker = &cursors.first; - else if (cursors.second.get_label_rect( + _grabbed_marker = &cursors.first(); + else if (cursors.second().get_label_rect( rect()).contains(e->pos())) - _grabbed_marker = &cursors.second; + _grabbed_marker = &cursors.second(); } } } @@ -209,9 +208,9 @@ void Ruler::draw_cursors(QPainter &p, unsigned int prefix) return; const QRect r = rect(); - pair &cursors = _view.cursors(); - cursors.first.paint_label(p, r, prefix); - cursors.second.paint_label(p, r, prefix); + CursorPair &cursors = _view.cursors(); + cursors.first().paint_label(p, r, prefix); + cursors.second().paint_label(p, r, prefix); } void Ruler::draw_hover_mark(QPainter &p)