From 0dd3aef6bc6af4e8af251279b1dcd4b3bb6887be Mon Sep 17 00:00:00 2001 From: James Crook Date: Mon, 9 Apr 2018 16:30:09 +0100 Subject: [PATCH] Bug 891 - Number-entering bug in kHz High Frequencies. Unfriendly to have to enter High first if new Low is above High. Spectral frequencies now behave like temporal selection, nudging the 'other' value up or down so that the low and high values don't cross over. --- src/toolbars/SpectralSelectionBar.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/toolbars/SpectralSelectionBar.cpp b/src/toolbars/SpectralSelectionBar.cpp index b8c26c793..ad8bb8bbb 100644 --- a/src/toolbars/SpectralSelectionBar.cpp +++ b/src/toolbars/SpectralSelectionBar.cpp @@ -311,11 +311,20 @@ void SpectralSelectionBar::ModifySpectralSelection(bool done) top = std::min(nyq, top); else top = SelectedRegion::UndefinedFrequency; + // These have to be in the right order. + if( bottom > top ){ + // Oops. We must fix the order. + if( mLowCtrl->HasFocus() ) + top = bottom; + else + bottom = top; + } } + mLow = bottom; mHigh = top; - SetBounds(); + //SetBounds(); // Notify project and track panel, which may change // the values again, and call back to us in SetFrequencies()