From f98809817d2df111713c0469fc26d787a728afd1 Mon Sep 17 00:00:00 2001 From: "james.k.crook@gmail.com" Date: Sat, 5 May 2012 18:41:48 +0000 Subject: [PATCH] Fixed bug in zoom-to-selection, where it would not work if the selection was 'beyond the end of time'. --- src/Project.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Project.cpp b/src/Project.cpp index 834229736..38e9198c9 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -1360,7 +1360,8 @@ void AudacityProject::FixScrollbars() // Add 1/4 of a screen of blank space to the end of the longest track mViewInfo.screen = ((double) panelWidth) / mViewInfo.zoom; - mViewInfo.total = mTracks->GetEndTime() + mViewInfo.screen / 4; + double LastTime = wxMax( mTracks->GetEndTime(), mViewInfo.sel1 ); + mViewInfo.total = LastTime + mViewInfo.screen / 4; // Don't remove time from total that's still on the screen if (mViewInfo.h > mViewInfo.total - mViewInfo.screen) {