short vertical lines

This commit is contained in:
Kizarm 2024-11-11 14:30:24 +01:00
parent 73d4e43f97
commit ada1425d83

View file

@ -264,18 +264,22 @@ void DisplayWidget::drawBackground() {
QPointF trg (m_ts->offset, m_ts->value + ofs); QPointF trg (m_ts->offset, m_ts->value + ofs);
QPen pc (QColor(0,128,255), 1); QPen pc (QColor(0,128,255), 1);
p.setPen(pc); p.setPen(pc);
const QLineF hline (xb, trg.y(), xe, trg.y()); const qreal pos = 30.0;
const QLineF vline (trg.x(), -ye, trg.x(), ye); const QLineF hline = m_forward.map(QLine(xb, trg.y(), xe, trg.y()));
p.drawLine (m_forward.map(hline)); const QLineF vline = m_forward.map(QLine(trg.x(), -ye, trg.x(), ye));
p.drawLine (m_forward.map(vline)); QPointF vb = vline.p1() + QPointF(0,-pos), ve = vline.p2() + QPointF(0,+pos);
p.drawLine (hline);
p.drawLine (QLineF(vb,ve));
// markers // markers
QPen pm (QColor(255,255,0,196), 1); QPen pm (QColor(255,255,0,196), 1);
p.setPen(pm); p.setPen(pm);
if (marker_type == MARKER_TIME) { if (marker_type == MARKER_TIME) {
const QLineF ma (m_time.a, -ye, m_time.a, ye); const QLineF ma = m_forward.map(QLine (m_time.a, -ye, m_time.a, ye));
const QLineF mb (m_time.b, -ye, m_time.b, ye); const QLineF mb = m_forward.map(QLine (m_time.b, -ye, m_time.b, ye));
p.drawLine (m_forward.map(ma)); vb = ma.p1() + QPointF(0,-pos), ve = ma.p2() + QPointF(0,+pos);
p.drawLine (m_forward.map(mb)); p.drawLine (QLineF(vb, ve));
vb = mb.p1() + QPointF(0,-pos), ve = mb.p2() + QPointF(0,+pos);
p.drawLine (QLineF(vb, ve));
} else { } else {
const QLineF ma (xb, m_volt.a, xe, m_volt.a); const QLineF ma (xb, m_volt.a, xe, m_volt.a);
const QLineF mb (xb, m_volt.b, xe, m_volt.b); const QLineF mb (xb, m_volt.b, xe, m_volt.b);