From c58d130c185f5d6a10cb830c77b5f4fd4d650557 Mon Sep 17 00:00:00 2001 From: David Bailes Date: Sat, 14 May 2016 17:22:28 +0100 Subject: [PATCH] Bug fix for audio position Fix for this bug: If the cursor/selection start is moved using the keyboard, then audio position shows the previous cursor/selection start. Simple fix in void AudacityProject::TP_DisplaySelection(). The play region is now updated before its start is used for audio position. --- src/Project.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Project.cpp b/src/Project.cpp index a3564f73a..f9bf9d073 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -4705,6 +4705,15 @@ void AudacityProject::TP_DisplaySelection() { double audioTime; + if (mRuler) { + if (!gAudioIO->IsBusy() && !mLockPlayRegion) + mRuler->SetPlayRegion(mViewInfo.selectedRegion.t0(), + mViewInfo.selectedRegion.t1()); + else + // Cause ruler redraw anyway, because we may be zooming or scrolling + mRuler->Refresh(); + } + if (gAudioIO->IsBusy()) audioTime = gAudioIO->GetStreamTime(); else { @@ -4719,14 +4728,6 @@ void AudacityProject::TP_DisplaySelection() (mViewInfo.selectedRegion.f0(), mViewInfo.selectedRegion.f1()); #endif - if (mRuler) { - if (!gAudioIO->IsBusy() && !mLockPlayRegion) - mRuler->SetPlayRegion(mViewInfo.selectedRegion.t0(), - mViewInfo.selectedRegion.t1()); - else - // Cause ruler redraw anyway, because we may be zooming or scrolling - mRuler->Refresh(); - } }