mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-09-06 23:27:53 -04:00
Fix bad frequency jumps at zoomed freq <= 1/2 samplerate
This commit is contained in:
parent
8c53bde031
commit
798c558c09
@ -146,6 +146,11 @@ void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
|||||||
if (freqMove != 0.0) {
|
if (freqMove != 0.0) {
|
||||||
long long newFreq = getCenterFrequency() + (long long)((long double)getBandwidth()*freqMove) * 0.01;
|
long long newFreq = getCenterFrequency() + (long long)((long double)getBandwidth()*freqMove) * 0.01;
|
||||||
|
|
||||||
|
long long minFreq = bandwidth/2;
|
||||||
|
if (newFreq < minFreq) {
|
||||||
|
newFreq = minFreq;
|
||||||
|
}
|
||||||
|
|
||||||
updateCenterFrequency(newFreq);
|
updateCenterFrequency(newFreq);
|
||||||
|
|
||||||
if (!freqMoving) {
|
if (!freqMoving) {
|
||||||
@ -434,7 +439,7 @@ void WaterfallCanvas::OnKeyDown(wxKeyEvent& event) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
long long minFreq = wxGetApp().getSampleRate()/2;
|
long long minFreq = bandwidth/2;
|
||||||
if (freq < minFreq) {
|
if (freq < minFreq) {
|
||||||
freq = minFreq;
|
freq = minFreq;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user