From: Leland Lucius <llucius@us...> - 2009-05-28 07:10:00
Update of /cvsroot/audacity/audacity-src/src
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv24621/src
This works around a problem where a selected region can be left scrolled off the left of the screen. Somewhere the calculations are getting mucked up and causes Fit To Selection to not quite zoom in enough to get the entire selected region within the visible area. If playback occurs and the playback cursor get to the end of the selected region, then the screen will scrolled and the selected region will be off the left of the screen.
This "fix" is a complete hack as I was not able to track down exactly where the miscalculation was, but it should work until we can track it down.
RCS file: /cvsroot/audacity/audacity-src/src/Menus.cpp,v
retrieving revision 1.479
retrieving revision 1.480
diff -u -d -r1.479 -r1.480
--- Menus.cpp 28 May 2009 04:57:59 -0000 1.479
+++ Menus.cpp 28 May 2009 07:09:40 -0000 1.480
@@ -4096,7 +4096,13 @@
if (mViewInfo.sel1 <= mViewInfo.sel0)
- Zoom(mViewInfo.zoom * mViewInfo.screen / (mViewInfo.sel1 - mViewInfo.sel0));
+ // LL: The "-1" is just a hack to get around an issue where zooming to
+ // selection doesn't actually get the entire selected region within the
+ // visible area. This causes a problem with scrolling at end of playback
+ // where the selected region may be scrolled off the left of the screen.
+ // I know this isn't right, but until the real rounding or 1-off issue is
+ // found, this will have to work.
+ Zoom(((mViewInfo.zoom * mViewInfo.screen) - 1) / (mViewInfo.sel1 - mViewInfo.sel0));