Skip to content

Commit

Permalink
Fix bad frequency jumps at zoomed freq <= 1/2 samplerate
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcliffe committed Oct 29, 2015
1 parent 8c53bde commit 798c558
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/visual/WaterfallCanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 798c558

Please sign in to comment.