X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fviews%2Ftrace%2Fdecodetrace.cpp;h=7bbc5a19b526cd5afa6856a578f1d03f989533df;hp=b4857336f9e6e1e350bc73e91ef6409bcc3f7e2e;hb=b9cdbe03be1155f56cf06aa921d72bc2b6dc527d;hpb=ded43869b4d6169b7f269af0623ef0a682e5b910 diff --git a/pv/views/trace/decodetrace.cpp b/pv/views/trace/decodetrace.cpp index b4857336..7bbc5a19 100644 --- a/pv/views/trace/decodetrace.cpp +++ b/pv/views/trace/decodetrace.cpp @@ -710,15 +710,13 @@ const QString DecodeTrace::get_annotation_at_point(const QPoint &point) QString() : annotations[0].annotations().front(); } -void DecodeTrace::hover_point_changed() +void DecodeTrace::hover_point_changed(const QPoint &hp) { assert(owner_); const View *const view = owner_->view(); assert(view); - QPoint hp = view->hover_point(); - if (hp.x() == 0) { QToolTip::hideText(); return; @@ -746,13 +744,14 @@ void DecodeTrace::hover_point_changed() // If it did, the tool tip would constantly hide and re-appear. // We also push it up by one row so that it appears above the // decode trace, not below. - hp.setX(hp.x() - (text_size.width() / 2) - padding); + QPoint p = hp; + p.setX(hp.x() - (text_size.width() / 2) - padding); - hp.setY(get_visual_y() - (row_height_ / 2) + + p.setY(get_visual_y() - (row_height_ / 2) + (hover_row * row_height_) - row_height_ - text_size.height() - padding); - QToolTip::showText(view->viewport()->mapToGlobal(hp), ann); + QToolTip::showText(view->viewport()->mapToGlobal(p), ann); } void DecodeTrace::create_decoder_form(int index,