MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / paintEvent

Method paintEvent

src/gui/ClientCompEditorCanvas.cpp:59–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59void ClientCompEditorCanvas::paintEvent(QPaintEvent* ev)
60{
61 ClientCompCurveWidget::paintEvent(ev);
62 if (!m_comp) return;
63
64 QPainter p(this);
65 p.setRenderHint(QPainter::Antialiasing, true);
66
67 // Threshold visual — full-height dashed amber guide line + a
68 // chevron at the bottom. Previously the handle was a tiny
69 // triangle that was easy to miss; the guide line now reads as
70 // "the threshold lives at this x" from a glance, and its whole
71 // column is draggable (see thresholdHandleHit).
72 const float T = m_comp->thresholdDb();
73 const float tx = dbToX(T);
74
75 const float curveY = dbToY(std::clamp(curveOutputDb(T), kMinDb, kMaxDb));
76 QColor guideColor = kThresholdHandle();
77 guideColor.setAlpha(160);
78 QPen guidePen(guideColor, 1.5, Qt::DashLine);
79 guidePen.setDashPattern({4.0, 3.0});
80 p.setPen(guidePen);
81 p.drawLine(QPointF(tx, curveY), QPointF(tx, rect().bottom() - 8.0f));
82
83 const float by = rect().bottom() - 2.0f;
84 QPainterPath tri;
85 tri.moveTo(tx, by - 14.0f);
86 tri.lineTo(tx - 9.0f, by);
87 tri.lineTo(tx + 9.0f, by);
88 tri.closeSubpath();
89 p.setBrush(kThresholdHandle());
90 p.setPen(QPen(kHandleOutline(), 1.5));
91 p.drawPath(tri);
92
93 // Ratio handle — larger filled dot at the knee centre so it reads
94 // as "drag me to change the slope." White outline so it stays
95 // visible against the cyan curve even when GR is 0.
96 const float outDb = curveOutputDb(T);
97 const QPointF rh(tx, dbToY(outDb));
98 p.setBrush(kRatioHandle());
99 p.setPen(QPen(kHandleOutline(), 1.2));
100 p.drawEllipse(rh, 6.5, 6.5);
101}
102
103void ClientCompEditorCanvas::mousePressEvent(QMouseEvent* ev)
104{

Callers

nothing calls this directly

Calls 6

paintEventFunction · 0.85
kThresholdHandleFunction · 0.85
kHandleOutlineFunction · 0.85
kRatioHandleFunction · 0.85
setAlphaMethod · 0.80
thresholdDbMethod · 0.45

Tested by

no test coverage detected