X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fdecodetrace.cpp;h=d97d01ef623931c2769c25dc5fe34b798cd6365c;hp=1cb9ce7154a9c302f15e3ecb63637f109f84286a;hb=a5d93c27b5bd6b95000e29c6cddac56ab254b289;hpb=dc747705ac06c9e9ab582b6b8b7cfc31003128e0 diff --git a/pv/view/decodetrace.cpp b/pv/view/decodetrace.cpp index 1cb9ce7..d97d01e 100644 --- a/pv/view/decodetrace.cpp +++ b/pv/view/decodetrace.cpp @@ -60,6 +60,7 @@ using std::list; using std::lock_guard; using std::make_pair; using std::max; +using std::make_pair; using std::map; using std::min; using std::pair; @@ -155,6 +156,16 @@ const std::shared_ptr& DecodeTrace::decoder() const return _decoder_stack; } +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; + return make_pair(-row_height / 2, row_height * 7 / 2); +} + void DecodeTrace::paint_back(QPainter &p, int left, int right) { Trace::paint_back(p, left, right);