mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 17:27:32 +00:00
Snap frequency to FM step on spectrum/waterfall click when Step is enabled
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -768,7 +768,8 @@ begin
|
||||
'if(dragging&&Math.abs(e.offsetX-dragX0)<4){' +
|
||||
// клик — не трогаем localCenter: фильтр встаёт точно туда куда кликнули.
|
||||
// Спектр остаётся на месте, сервер пришлёт center_hz через ~200ms и всё перецентрируется.
|
||||
'const nf=cl(Math.round(xToHz(e.offsetX,cv.clientWidth)/100)*100,vfoMin(),vfoMax());' +
|
||||
'const snap=(cur.mode===5&&inFMStep)?FM_STEP_HZ[fmStepIdx]:100;' +
|
||||
'const nf=cl(Math.round(xToHz(e.offsetX,cv.clientWidth)/snap)*snap,vfoMin(),vfoMax());' +
|
||||
'setActiveVfoHz(nf);' +
|
||||
'if(activeVfo==="A")cur.vfo_a_hz=nf;else cur.vfo_b_hz=nf;' +
|
||||
'renderVfos();pend("freq");ws2({cmd:"freq",hz:nf});' +
|
||||
|
||||
Reference in New Issue
Block a user