From: Uwe Hermann Date: Fri, 31 Jan 2014 20:29:56 +0000 (+0100) Subject: pv::view::DecodeTrace: Draw annotation rows according to PD metadata. X-Git-Tag: pulseview-0.2.0~98 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=7e674e4331e768b9b29a20fed8419e0b6686357e;ds=sidebyside pv::view::DecodeTrace: Draw annotation rows according to PD metadata. --- diff --git a/pv/view/decodetrace.cpp b/pv/view/decodetrace.cpp index 37beed98..8c230ad4 100644 --- a/pv/view/decodetrace.cpp +++ b/pv/view/decodetrace.cpp @@ -155,9 +155,15 @@ void DecodeTrace::paint_mid(QPainter &p, int left, int right) assert(_decoder_stack); vector annotations(_decoder_stack->annotations()); - BOOST_FOREACH(const Annotation &a, annotations) + + BOOST_FOREACH(const Annotation &a, annotations) { + // Every annotation row is 20 pixels further down. + int y_ann_row_offset = a.row() * 20; + draw_annotation(a, p, get_text_colour(), h, left, right, - samples_per_pixel, pixels_offset, y); + samples_per_pixel, pixels_offset, + y + y_ann_row_offset); + } draw_unresolved_period(p, h, left, right, samples_per_pixel, pixels_offset);