X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fview%2Fdecodetrace.cpp;h=6f14732d2bddc56a9b71ed6bf24af6cd15447d79;hb=1df18f6b6d20abd3f1ede94325b6781bf5038ea9;hp=7ed66b3e12c351d7cae7763cd3f3b4710c913a18;hpb=3eb29afdb641606c2e2e059289d8cc103d027a25;p=pulseview.git diff --git a/pv/view/decodetrace.cpp b/pv/view/decodetrace.cpp index 7ed66b3..6f14732 100644 --- a/pv/view/decodetrace.cpp +++ b/pv/view/decodetrace.cpp @@ -160,24 +160,21 @@ pair DecodeTrace::v_extents() const { /// @todo Replace this with an implementation that knows the true /// height of the trace - QFontMetrics m(QApplication::font()); - const int text_height = m.boundingRect(QRect(), 0, "Tg").height(); - const int row_height = (text_height * 6) / 4; + const int row_height = (RowItemPaintParams::text_height() * 6) / 4; return make_pair(-row_height / 2, row_height * 7 / 2); } void DecodeTrace::paint_back(QPainter &p, const RowItemPaintParams &pp) { Trace::paint_back(p, pp); - paint_axis(p, get_visual_y(), pp.left(), pp.right()); + paint_axis(p, pp, get_visual_y()); } void DecodeTrace::paint_mid(QPainter &p, const RowItemPaintParams &pp) { using namespace pv::data::decode; - QFontMetrics m(QApplication::font()); - text_height_ = m.boundingRect(QRect(), 0, "Tg").height(); + text_height_ = RowItemPaintParams::text_height(); row_height_ = (text_height_ * 6) / 4; const int annotation_height = (text_height_ * 5) / 4; @@ -484,11 +481,11 @@ void DecodeTrace::draw_unresolved_period(QPainter &p, int h, int left, ((data = logic_signal->logic_data()))) break; - if (!data || data->get_snapshots().empty()) + if (!data || data->logic_snapshots().empty()) return; const shared_ptr snapshot = - data->get_snapshots().front(); + data->logic_snapshots().front(); assert(snapshot); const int64_t sample_count = (int64_t)snapshot->get_sample_count(); if (sample_count == 0)