round to absolute frequency when clicking waterfall, not relative to center_freq

This commit is contained in:
J.W. Jagersma 2020-09-27 23:59:57 +02:00
parent 5a45ff3171
commit 0d071f1a06
No known key found for this signature in database
GPG Key ID: 438BF81BA7510C54

View File

@ -545,7 +545,9 @@ function canvas_mouseup(evt) {
var relativeX = get_relative_x(evt); var relativeX = get_relative_x(evt);
if (!canvas_drag) { 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 { else {
canvas_end_drag(); canvas_end_drag();