[feat](trx-frontend-http): tune SDR spectrum with ctrl-scroll

Signed-off-by: Stan Grams <sjg@haxx.space>
Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
2026-02-27 23:05:20 +01:00
parent bc206e8f6b
commit 071157e5bf
2 changed files with 7 additions and 9 deletions
@@ -2719,19 +2719,17 @@ if (spectrumCanvas) {
spectrumCanvas.addEventListener("wheel", (e) => {
e.preventDefault();
if (!lastSpectrumData) return;
if (e.ctrlKey) {
const direction = e.deltaY < 0 ? 1 : -1;
jogFreq(direction);
return;
}
const rect = spectrumCanvas.getBoundingClientRect();
const cssX = e.clientX - rect.left;
const factor = e.deltaY < 0 ? 1.25 : 1 / 1.25;
spectrumZoomAt(cssX, rect.width, lastSpectrumData, factor);
drawSpectrum(lastSpectrumData);
}, { passive: false });
// Double-click → reset zoom/pan
spectrumCanvas.addEventListener("dblclick", () => {
spectrumZoom = 1;
spectrumPanFrac = 0.5;
if (lastSpectrumData) drawSpectrum(lastSpectrumData);
});
}
// ── BW strip edge hit-test (CSS pixels) ──────────────────────────────────────