From cfdbcf9bc3cf4b564e3be91ca765312a27791ee5 Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" Date: Mon, 14 Mar 2016 19:27:34 -0400 Subject: [PATCH] Patch major font rendering performance hit while zoomed --- src/panel/SpectrumPanel.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/panel/SpectrumPanel.cpp b/src/panel/SpectrumPanel.cpp index 699887f..5fcf2f6 100644 --- a/src/panel/SpectrumPanel.cpp +++ b/src/panel/SpectrumPanel.cpp @@ -222,8 +222,15 @@ void SpectrumPanel::drawPanelContents() { fontEnumSize = GLFont::GLFONT_SIZE16; hPos = 1.0 - (18.0 / viewHeight); } - + for (double m = -1.0 + mhzStart, mMax = 1.0 + ((mhzStart>0)?mhzStart:-mhzStart); m <= mMax; m += mhzStep) { + if (m < -1.0) { + currentMhz += mhzVisualStep; + continue; + } + if (m > 1.0) { + break; + } label << std::fixed << currentMhz; double fractpart, intpart;