From 0d071f1a06adedb9bcd92060c873244cdddd1664 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 27 Sep 2020 23:59:57 +0200 Subject: [PATCH] round to absolute frequency when clicking waterfall, not relative to center_freq --- htdocs/openwebrx.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index f9aa85a..b8cbc16 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -545,7 +545,9 @@ function canvas_mouseup(evt) { var relativeX = get_relative_x(evt); if (!canvas_drag) { - $('#openwebrx-panel-receiver').demodulatorPanel().getDemodulator().set_offset_frequency(Math.round(canvas_get_freq_offset(relativeX)/100)*100); + var step = 100; + var freq = Math.round((canvas_get_frequency(relativeX)) / step) * step - center_freq; + $('#openwebrx-panel-receiver').demodulatorPanel().getDemodulator().set_offset_frequency(freq); } else { canvas_end_drag();