]> sigrok.org Git - pulseview.git/blobdiff - pv/view/cursorpair.cpp
CursorHeader: Paint by the labels by the time item list
[pulseview.git] / pv / view / cursorpair.cpp
index 2ff32c53ef9fbbe4d46b2d1d8fb22425ee03626f..ecce13893def06fb3e4c3f8559d412ef8d2fa5cc 100644 (file)
@@ -106,6 +106,9 @@ void CursorPair::paint_label(QPainter &p, const QRect &rect)
        assert(first_);
        assert(second_);
 
+       if (!enabled())
+               return;
+
        const unsigned int prefix = view_.tick_prefix();
 
        compute_text_size(p, prefix);
@@ -137,10 +140,6 @@ void CursorPair::paint_label(QPainter &p, const QRect &rect)
                p.drawText(text_rect, Qt::AlignCenter | Qt::AlignVCenter,
                        pv::util::format_time(second_->time() - first_->time(), prefix, 2));
        }
-
-       // Paint the cursor markers
-       first_->paint_label(p, rect);
-       second_->paint_label(p, rect);
 }
 
 void CursorPair::draw_viewport_background(QPainter &p,