From 197fae650383545e2d008a573600a6141b494048 Mon Sep 17 00:00:00 2001 From: Sultan Qasim Khan Date: Fri, 11 Aug 2023 03:20:08 -0400 Subject: [PATCH] plotter: prevent zooming gain out-of-bounds In some situations, it was possible to zoom in a way that causes the minimum dB value in the plotter to become too low. --- src/qtgui/plotter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qtgui/plotter.cpp b/src/qtgui/plotter.cpp index 2995ff3750..c283a42438 100644 --- a/src/qtgui/plotter.cpp +++ b/src/qtgui/plotter.cpp @@ -1025,6 +1025,9 @@ void CPlotter::wheelEvent(QWheelEvent * event) m_PandMaxdB = FFT_MAX_DB; m_PandMindB = m_PandMaxdB - db_range; + if (m_PandMindB < FFT_MIN_DB) + m_PandMindB = FFT_MIN_DB; + m_MaxHoldValid = false; m_MinHoldValid = false; m_histIIRValid = false;