]> sigrok.org Git - pulseview.git/commitdiff
Trace: Fixed background rectangle
authorJoel Holdsworth <redacted>
Wed, 26 Apr 2017 16:13:08 +0000 (10:13 -0600)
committerUwe Hermann <redacted>
Wed, 3 May 2017 17:08:10 +0000 (19:08 +0200)
It previously ignored the left x-coordinate, and left a 1-pixel
gap at the right-hand side.

pv/view/trace.cpp

index 2a1eb959634fb23289cc1b12fa8c5613ef795e81..66f13edb12dac9b4cf4795af5916c026f1713772 100644 (file)
@@ -164,13 +164,8 @@ void Trace::paint_back(QPainter &p, const ViewItemPaintParams &pp)
        p.setPen(QPen(Qt::NoPen));
 
        const pair<int, int> extents = v_extents();
-
-       const int x = 0;
-       const int y = get_visual_y() + extents.first;
-       const int w = pp.right() - pp.left();
-       const int h = extents.second - extents.first;
-
-       p.drawRect(x, y, w, h);
+       p.drawRect(pp.left(), get_visual_y() + extents.first,
+               pp.width(), extents.second - extents.first);
 }
 
 void Trace::paint_axis(QPainter &p, const ViewItemPaintParams &pp, int y)