]> sigrok.org Git - pulseview.git/commitdiff
Trace: Make paint_axis take RowItemPaintParams
authorJoel Holdsworth <redacted>
Mon, 24 Nov 2014 19:17:27 +0000 (19:17 +0000)
committerJoel Holdsworth <redacted>
Tue, 9 Dec 2014 18:24:59 +0000 (18:24 +0000)
pv/view/analogsignal.cpp
pv/view/decodetrace.cpp
pv/view/logicsignal.cpp
pv/view/trace.cpp
pv/view/trace.hpp

index a7a69218bb4f12a25c97185068f8148cee959d01..325ab6bd301e00e610f51e9997367b0a9cb9cd58 100644 (file)
@@ -90,7 +90,7 @@ std::pair<int, int> AnalogSignal::v_extents() const
 void AnalogSignal::paint_back(QPainter &p, const RowItemPaintParams &pp)
 {
        if (channel_->enabled())
-               paint_axis(p, get_visual_y(), pp.left(), pp.right());
+               paint_axis(p, pp, get_visual_y());
 }
 
 void AnalogSignal::paint_mid(QPainter &p, const RowItemPaintParams &pp)
index 7ed66b3e12c351d7cae7763cd3f3b4710c913a18..0b129c3bf7b9d45acb6a69e89d0433576f3a4d6c 100644 (file)
@@ -169,7 +169,7 @@ pair<int, int> DecodeTrace::v_extents() const
 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)
index af992c6bac175391ffd7a3941f59c1a1ae036266..1ee99cb90595a46a9ff57fceae478d57399cf78b 100644 (file)
@@ -148,7 +148,7 @@ std::pair<int, int> LogicSignal::v_extents() const
 void LogicSignal::paint_back(QPainter &p, const RowItemPaintParams &pp)
 {
        if (channel_->enabled())
-               paint_axis(p, get_visual_y(), pp.left(), pp.right());
+               paint_axis(p, pp, get_visual_y());
 }
 
 void LogicSignal::paint_mid(QPainter &p, const RowItemPaintParams &pp)
index 1734921a57c568585c648b177f8ce29019eb1a5e..fd440185c4e9c376e4c5cef307c4b88e79e1b923 100644 (file)
@@ -167,10 +167,10 @@ QColor Trace::get_text_colour() const
        return (colour_.lightness() > 64) ? Qt::black : Qt::white;
 }
 
-void Trace::paint_axis(QPainter &p, int y, int left, int right)
+void Trace::paint_axis(QPainter &p, const RowItemPaintParams &pp, int y)
 {
        p.setPen(AxisPen);
-       p.drawLine(QPointF(left, y + 0.5f), QPointF(right, y + 0.5f));
+       p.drawLine(QPointF(pp.left(), y + 0.5f), QPointF(pp.right(), y + 0.5f));
 }
 
 void Trace::add_colour_option(QWidget *parent, QFormLayout *form)
index 88df33eadb0bddc74ff00b61774eba65ecdb757c..c0b94df26c00f86fbf61b5d673131e95a472165e 100644 (file)
@@ -107,11 +107,10 @@ protected:
        /**
         * Paints a zero axis across the viewport.
         * @param p the QPainter to paint into.
+        * @param pp the painting parameters object to paint with.
         * @param y the y-offset of the axis.
-        * @param left the x-coordinate of the left edge of the view.
-        * @param right the x-coordinate of the right edge of the view.
         */
-       void paint_axis(QPainter &p, int y, int left, int right);
+       void paint_axis(QPainter &p, const RowItemPaintParams &pp, int y);
 
        void add_colour_option(QWidget *parent, QFormLayout *form);