Skip to content

Commit

Permalink
use field
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzawa-san committed Oct 25, 2024
1 parent 7f3f574 commit 5d07847
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/qtgui/plotter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1591,16 +1591,15 @@ void CPlotter::draw(bool newData)

if (m_FftFill && m_PlotMode != PLOT_MODE_HISTOGRAM)
{
QLineF lines[npts];
qreal yFillMax = 0;
for (i = 0; i < npts; i++)
{
QPointF yFill = m_PlotMode == PLOT_MODE_MAX ? m_maxLineBuf[i] : m_avgLineBuf[i];
lines[i] = QLineF(yFill, QPointF(yFill.x(), plotHeight));
m_fillLineBuf[i] = QLineF(yFill, QPointF(yFill.x(), plotHeight));
yFillMax = std::max(yFillMax, yFill.y());
}
painter2.setPen(QPen(m_FftFillCol));
painter2.drawLines(lines, npts);
painter2.drawLines(m_fillLineBuf, npts);
painter2.fillRect(QRectF(xmin, yFillMax, npts, plotHeight - yFillMax), QBrush(m_FftFillCol));
}

Expand Down Expand Up @@ -1654,13 +1653,12 @@ void CPlotter::draw(bool newData)

if (m_PlotMode == PLOT_MODE_FILLED)
{
QLineF lines[npts];
for (i = 0; i < npts; i++)
{
lines[i] = QLineF(m_maxLineBuf[i], m_avgLineBuf[i]);
m_fillLineBuf[i] = QLineF(m_maxLineBuf[i], m_avgLineBuf[i]);
}
painter2.setPen(QPen(m_FilledModeFillCol));
painter2.drawLines(lines, npts);
painter2.drawLines(m_fillLineBuf, npts);
}

if (doMaxLine)
Expand Down
1 change: 1 addition & 0 deletions src/qtgui/plotter.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ public slots:
QPointF m_avgLineBuf[MAX_SCREENSIZE]{};
QPointF m_maxLineBuf[MAX_SCREENSIZE]{};
QPointF m_holdLineBuf[MAX_SCREENSIZE]{};
QLineF m_fillLineBuf[MAX_SCREENSIZE]{};
float m_histMaxIIR;
std::vector<float> m_fftIIR;
std::vector<float> m_fftData;
Expand Down

0 comments on commit 5d07847

Please sign in to comment.