[fix](trx-frontend-http): center BW overlay on active virtual channel freq

When subscribed to a non-primary virtual channel the bandwidth overlay
was still anchored to lastFreqHz (channel 0).  Resolve the effective
center from the active vchan when vchanIsOnVirtual() is true.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-03-11 07:30:24 +01:00
parent 4bb7248257
commit 3d284abab6
@@ -924,8 +924,12 @@ function drawSignalOverlay() {
} }
} }
if (lastFreqHz != null && currentBandwidthHz > 0) { const _bwCenterHz = (typeof vchanIsOnVirtual === "function" && vchanIsOnVirtual() &&
for (const spec of visibleBandwidthSpecs(lastFreqHz)) { typeof vchanActiveChannel === "function")
? (vchanActiveChannel()?.freq_hz ?? lastFreqHz)
: lastFreqHz;
if (_bwCenterHz != null && currentBandwidthHz > 0) {
for (const spec of visibleBandwidthSpecs(_bwCenterHz)) {
const span = displaySpanForBandwidthSpec(spec); const span = displaySpanForBandwidthSpec(spec);
const xL = hzToX(span.loHz); const xL = hzToX(span.loHz);
const xR = hzToX(span.hiHz); const xR = hzToX(span.hiHz);