From a2054ad780813a21abc99736c9d17bcafc1caa15 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Sun, 31 Mar 2024 23:00:50 +0200 Subject: [PATCH] fix #1367 --- core/src/gui/main_window.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/core/src/gui/main_window.cpp b/core/src/gui/main_window.cpp index 8ed95324..de690fc5 100644 --- a/core/src/gui/main_window.cpp +++ b/core/src/gui/main_window.cpp @@ -576,20 +576,20 @@ void MainWindow::draw() { // Handle scrollwheel int wheel = ImGui::GetIO().MouseWheel; if (wheel != 0 && (gui::waterfall.mouseInFFT || gui::waterfall.mouseInWaterfall)) { - // Select factor depending on modifier keys - double interval; - if (ImGui::IsKeyDown(ImGuiKey_LeftShift)) { - interval = vfo->snapInterval * 10.0; - } - else if (ImGui::IsKeyDown(ImGuiKey_LeftAlt)) { - interval = vfo->snapInterval * 0.1; - } - else { - interval = vfo->snapInterval; - } - double nfreq; if (vfo != NULL) { + // Select factor depending on modifier keys + double interval; + if (ImGui::IsKeyDown(ImGuiKey_LeftShift)) { + interval = vfo->snapInterval * 10.0; + } + else if (ImGui::IsKeyDown(ImGuiKey_LeftAlt)) { + interval = vfo->snapInterval * 0.1; + } + else { + interval = vfo->snapInterval; + } + nfreq = gui::waterfall.getCenterFrequency() + vfo->generalOffset + (interval * wheel); nfreq = roundl(nfreq / interval) * interval; }