[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:
@@ -924,8 +924,12 @@ function drawSignalOverlay() {
|
||||
}
|
||||
}
|
||||
|
||||
if (lastFreqHz != null && currentBandwidthHz > 0) {
|
||||
for (const spec of visibleBandwidthSpecs(lastFreqHz)) {
|
||||
const _bwCenterHz = (typeof vchanIsOnVirtual === "function" && vchanIsOnVirtual() &&
|
||||
typeof vchanActiveChannel === "function")
|
||||
? (vchanActiveChannel()?.freq_hz ?? lastFreqHz)
|
||||
: lastFreqHz;
|
||||
if (_bwCenterHz != null && currentBandwidthHz > 0) {
|
||||
for (const spec of visibleBandwidthSpecs(_bwCenterHz)) {
|
||||
const span = displaySpanForBandwidthSpec(spec);
|
||||
const xL = hzToX(span.loHz);
|
||||
const xR = hzToX(span.hiHz);
|
||||
|
||||
Reference in New Issue
Block a user