From 1cd188d42292795984f68fd21a7c5f6ca18d3652 Mon Sep 17 00:00:00 2001 From: Clayton Smith Date: Tue, 3 Oct 2023 09:23:17 -0400 Subject: [PATCH] Make out-of-range values visible at the bottom of the plot --- src/qtgui/plotter.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qtgui/plotter.cpp b/src/qtgui/plotter.cpp index b5d17ae7a..cadf5cf68 100644 --- a/src/qtgui/plotter.cpp +++ b/src/qtgui/plotter.cpp @@ -1545,10 +1545,10 @@ void CPlotter::draw(bool newData) const qreal ixPlot = (qreal)ix; const qreal yMaxD = (qreal)std::max(std::min( panddBGainFactor * (m_PandMaxdB - 10.0f * log10f(m_fftMaxBuf[ix])), - (float)plotHeight), 0.0f); + (float)plotHeight - 1.0f), 0.0f); const qreal yAvgD = (qreal)std::max(std::min( panddBGainFactor * (m_PandMaxdB - 10.0f * log10f(m_fftAvgBuf[ix])), - (float)plotHeight), 0.0f); + (float)plotHeight - 1.0f), 0.0f); if (m_PlotMode == PLOT_MODE_HISTOGRAM) { @@ -1617,7 +1617,7 @@ void CPlotter::draw(bool newData) const qreal ixPlot = (qreal)ix; const qreal yMaxHoldD = (qreal)std::max(std::min( panddBGainFactor * (m_PandMaxdB - 10.0f * log10f(m_fftMaxHoldBuf[ix])), - (float)plotHeight), 0.0f); + (float)plotHeight - 1.0f), 0.0f); maxLineBuf[i] = QPointF(ixPlot, yMaxHoldD); } // NOT scaling to DPR due to performance @@ -1637,7 +1637,7 @@ void CPlotter::draw(bool newData) const qreal ixPlot = (qreal)ix; const qreal yMinHoldD = (qreal)std::max(std::min( panddBGainFactor * (m_PandMaxdB - 10.0f * log10f(m_fftMinHoldBuf[ix])), - (float)plotHeight), 0.0f); + (float)plotHeight - 1.0f), 0.0f); maxLineBuf[i] = QPointF(ixPlot, yMinHoldD); } // NOT scaling to DPR due to performance @@ -1687,7 +1687,7 @@ void CPlotter::draw(bool newData) { const qreal y = (qreal)std::max(std::min( panddBGainFactor * (m_PandMaxdB - 10.0f * log10f(vi)), - (float)plotHeight - 0.0f), 0.0f); + (float)plotHeight - 1.0f), 0.0f); m_Peaks[ix] = y; } } @@ -1711,7 +1711,7 @@ void CPlotter::draw(bool newData) { const qreal y = (qreal)std::max(std::min( panddBGainFactor * (m_PandMaxdB - 10.0f * log10f(vi)), - (float)plotHeight - 0.0f), 0.0f); + (float)plotHeight - 1.0f), 0.0f); // Show the wider peak only if there is no very close narrow peak bool found = false;