From 0dfcada3f2da823202f9cd1ee7a91ed9171ce7fe Mon Sep 17 00:00:00 2001 From: Clayton Smith Date: Wed, 27 Sep 2023 12:34:03 -0400 Subject: [PATCH] Fix inconsistent 1-2-5 scaling of amplitude axis --- resources/news.txt | 1 + src/qtgui/plotter.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/news.txt b/resources/news.txt index 9b54c088a..2f84aaf2a 100644 --- a/resources/news.txt +++ b/resources/news.txt @@ -36,6 +36,7 @@ FIXED: Crash in AFSK1200 decoder. FIXED: Y axis in saved waterfall is too narrow. FIXED: Hang when setting a very narrow filter width. + FIXED: Inconsistent 1-2-5 scaling of amplitude axis. 2.16: Released April 28, 2023 diff --git a/src/qtgui/plotter.cpp b/src/qtgui/plotter.cpp index 72ae6868a..66a091f87 100644 --- a/src/qtgui/plotter.cpp +++ b/src/qtgui/plotter.cpp @@ -2223,8 +2223,9 @@ void CPlotter::drawOverlay() // Level grid qint64 mindBAdj64 = 0; qint64 dbDivSize = 0; + qint64 dbSpan = (qint64) (m_PandMaxdB - m_PandMindB); - calcDivSize((qint64) m_PandMindB, (qint64) m_PandMaxdB, + calcDivSize((qint64) m_PandMindB, ((qint64) m_PandMindB) + dbSpan, qMax(h / (m_VdivDelta * m_DPR), (qreal)VERT_DIVS_MIN), mindBAdj64, dbDivSize, m_VerDivs);