Fix bad frequency jumps at zoomed freq <= 1/2 samplerate

This commit is contained in:
Charles J. Cliffe 2015-10-28 22:07:06 -04:00
parent 8c53bde031
commit 798c558c09

View File

@ -146,6 +146,11 @@ void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
if (freqMove != 0.0) {
long long newFreq = getCenterFrequency() + (long long)((long double)getBandwidth()*freqMove) * 0.01;
long long minFreq = bandwidth/2;
if (newFreq < minFreq) {
newFreq = minFreq;
}
updateCenterFrequency(newFreq);
if (!freqMoving) {
@ -434,7 +439,7 @@ void WaterfallCanvas::OnKeyDown(wxKeyEvent& event) {
return;
}
long long minFreq = wxGetApp().getSampleRate()/2;
long long minFreq = bandwidth/2;
if (freq < minFreq) {
freq = minFreq;
}