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)
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)
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)
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)
/**
* 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);