From: Joel Holdsworth Date: Sat, 20 Dec 2014 10:38:40 +0000 (+0000) Subject: CursorPair: Set font before calling compute_text_size X-Git-Tag: pulseview-0.3.0~342 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f106fc3a2d824745744d5c96039966434d56af64;p=pulseview.git CursorPair: Set font before calling compute_text_size --- diff --git a/pv/view/cursorpair.cpp b/pv/view/cursorpair.cpp index 859f6fde..c5a1bc99 100644 --- a/pv/view/cursorpair.cpp +++ b/pv/view/cursorpair.cpp @@ -110,7 +110,10 @@ void CursorPair::paint_label(QPainter &p, const QRect &rect) return; const unsigned int prefix = view_.tick_prefix(); + const QColor text_colour = + ViewItem::select_text_colour(Cursor::FillColour); + p.setPen(text_colour); compute_text_size(p, prefix); QRectF delta_rect(label_rect(rect)); @@ -135,8 +138,7 @@ void CursorPair::paint_label(QPainter &p, const QRect &rect) p.setPen(Cursor::FillColour.lighter()); p.drawRoundedRect(delta_rect, highlight_radius, highlight_radius); - p.setPen(ViewItem::select_text_colour( - Cursor::FillColour)); + p.setPen(text_colour); p.drawText(text_rect, Qt::AlignCenter | Qt::AlignVCenter, pv::util::format_time(second_->time() - first_->time(), prefix, 2)); }