Compare commits
4 Commits
d674c25a29
...
327e0d7dae
| Author | SHA1 | Date |
|---|---|---|
|
|
327e0d7dae | |
|
|
d78c85d4ad | |
|
|
840fe5a11f | |
|
|
632b6e4112 |
|
|
@ -677,28 +677,32 @@ void VisualizerWidget::buildVertices(int w, int h) {
|
|||
float fr = fillColor.redF(), fg = fillColor.greenF(),
|
||||
fb = fillColor.blueF(), fa = fillColor.alphaF();
|
||||
|
||||
// In mirrored mode, fade anchor edge to transparent to hide mirror seam
|
||||
float faAnchor = m_mirrored ? 0.0f : fa;
|
||||
|
||||
// Triangle 1
|
||||
m_vertices.insert(m_vertices.end(),
|
||||
{x1, anchorY, fr, fg, fb, fa, x1, y1, fr, fg, fb, fa,
|
||||
{x1, anchorY, fr, fg, fb, faAnchor, x1, y1, fr, fg, fb, fa,
|
||||
x2, y2, fr, fg, fb, fa});
|
||||
// Triangle 2
|
||||
m_vertices.insert(m_vertices.end(),
|
||||
{x1, anchorY, fr, fg, fb, fa, x2, y2, fr, fg, fb, fa,
|
||||
x2, anchorY, fr, fg, fb, fa});
|
||||
{x1, anchorY, fr, fg, fb, faAnchor, x2, y2, fr, fg, fb, fa,
|
||||
x2, anchorY, fr, fg, fb, faAnchor});
|
||||
m_fillVertexCount += 6;
|
||||
|
||||
float lr = lineColor.redF(), lg = lineColor.greenF(),
|
||||
lb = lineColor.blueF(), la = lineColor.alphaF();
|
||||
float laAnchor = m_mirrored ? 0.0f : la;
|
||||
|
||||
// Left edge
|
||||
lineVerts.insert(lineVerts.end(),
|
||||
{x1, anchorY, lr, lg, lb, la, x1, y1, lr, lg, lb, la});
|
||||
{x1, anchorY, lr, lg, lb, laAnchor, x1, y1, lr, lg, lb, la});
|
||||
|
||||
// Right edge (last bin only)
|
||||
if (i + 2 == freqs.size()) {
|
||||
lineVerts.insert(
|
||||
lineVerts.end(),
|
||||
{x2, anchorY, lr, lg, lb, la, x2, y2, lr, lg, lb, la});
|
||||
{x2, anchorY, lr, lg, lb, laAnchor, x2, y2, lr, lg, lb, la});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,6 +68,8 @@ private:
|
|||
int m_targetFps = 60;
|
||||
qint64 m_lastFrameTime = 0;
|
||||
bool m_dataDirty = false;
|
||||
int m_lastBuildW = 0;
|
||||
int m_lastBuildH = 0;
|
||||
|
||||
// RHI resources
|
||||
QRhi *m_rhi = nullptr;
|
||||
|
|
|
|||
Loading…
Reference in New Issue