Fix mouse wheel always tuning VFO A regardless of active VFO

FormMouseWheel quantized from FVfoA and always called ApplyVfoA, so the
wheel tuned VFO A even when VFO B was active. Pre-existing bug (the wheel
handler never branched on FActiveVfo), surfaced while testing VFO B.

Quantize from ActiveVfoFreq and route to SetVfoB when B is active.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Uladzimir Karpenka
2026-06-04 20:31:04 +03:00
co-authored by Claude Opus 4.8
parent eb10283c85
commit 9d48f26dd8
+8 -4
View File
@@ -6937,13 +6937,14 @@ begin
Delta := 1;
if WheelDelta < 0 then Delta := -1;
// Квантование (та же логика что в FreqDisplay.ChangeByDigit)
Base := (Round(FController.FVfoA) div Step) * Step;
// Квантование (та же логика что в FreqDisplay.ChangeByDigit) — от частоты
// АКТИВНОГО VFO, а не всегда VFO A.
Base := (ActiveVfoFreq div Step) * Step;
if Delta > 0 then
NewFreq := Base + Step
else
begin
if Round(FController.FVfoA) = Base then
if ActiveVfoFreq = Base then
NewFreq := Base - Step
else
NewFreq := Base; // снэп к нижней границе
@@ -6955,7 +6956,10 @@ begin
NewFreq := Max(0, NewFreq)
else
NewFreq := Max(30000, Min(60000000, NewFreq));
ApplyVfoA(NewFreq);
if FController.FActiveVfo = 0 then
ApplyVfoA(NewFreq)
else
FController.SetVfoB(NewFreq); // крутим активный VFO B
Handled := True;
end;