1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-05 14:18:53 +02:00

Fixed bug in zoom-to-selection, where it would not work if the selection was 'beyond the end of time'.

This commit is contained in:
james.k.crook@gmail.com 2012-05-05 18:41:48 +00:00
parent 5a8a515235
commit f98809817d

View File

@ -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) {