]> sigrok.org Git - pulseview.git/blobdiff - pv/view/decodesignal.cpp
Improved annotation painting
[pulseview.git] / pv / view / decodesignal.cpp
index 33ea33f381e484391c82ec7cb83427b45d3a252f..f6611a0f05205c8e2f88c392a2b1f944ecc6abe1 100644 (file)
@@ -60,12 +60,17 @@ void DecodeSignal::set_view(pv::view::View *view)
        Trace::set_view(view);
 }
 
-void DecodeSignal::paint(QPainter &p, int left, int right)
+void DecodeSignal::paint_back(QPainter &p, int left, int right)
+{
+       paint_axis(p, get_y(), left, right);
+}
+
+void DecodeSignal::paint_mid(QPainter &p, int left, int right)
 {
        using namespace pv::view::decode;
 
        assert(_view);
-       const int y = _v_offset - _view->v_offset();
+       const int y = get_y();
 
        const double scale = _view->scale();
        assert(scale > 0);
@@ -84,7 +89,9 @@ void DecodeSignal::paint(QPainter &p, int left, int right)
        vector< shared_ptr<Annotation> > annotations(_decoder->annotations());
        BOOST_FOREACH(shared_ptr<Annotation> a, annotations) {
                assert(a);
-               a->paint(p, left, right, samples_per_pixel, pixels_offset, y);
+               a->paint(p, _colour, _colour.darker(), get_text_colour(),
+                       _text_size.height(), left, right, samples_per_pixel,
+                       pixels_offset, y);
        }
 }