]> sigrok.org Git - pulseview.git/blobdiff - pv/view/trace.cpp
Fix an isnan() issue on (at least) MinGW and Mac OS X.
[pulseview.git] / pv / view / trace.cpp
index df5a954b43a216f66d7cb11c5799464d882a3fe4..a96b0327e0e6ffd6f5364876b928ebaa87077daf 100644 (file)
@@ -134,6 +134,8 @@ pv::widgets::Popup* Trace::create_popup(QWidget *parent)
        using pv::widgets::Popup;
 
        popup_ = new Popup(parent);
+       popup_->set_position(parent->mapToGlobal(
+               point(parent->rect())), Popup::Right);
 
        create_popup_form();
 
@@ -161,6 +163,13 @@ QRectF Trace::label_rect(const QRectF &rect) const
                label_size.height());
 }
 
+QRectF Trace::hit_box_rect(const QRectF &rect) const
+{
+       const float h = QFontMetrics(QApplication::font()).height();
+       return QRectF(rect.left(), get_visual_y() - h / 2.0f,
+               rect.width(), h);
+}
+
 void Trace::paint_axis(QPainter &p, const ViewItemPaintParams &pp, int y)
 {
        p.setPen(AxisPen);