Update of /cvsroot/audacity/audacity-src/src
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv9993

Modified Files:
        TrackPanel.h TrackPanel.cpp 
Log Message:
Implement shift key when zooming to reflect pointer change

Index: TrackPanel.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/TrackPanel.cpp,v
retrieving revision 1.328
retrieving revision 1.329
diff -u -d -r1.328 -r1.329
--- TrackPanel.cpp      15 Oct 2006 03:30:15 -0000      1.328
+++ TrackPanel.cpp      22 Oct 2006 19:34:18 -0000      1.329
@@ -2278,7 +2278,7 @@
    }
 
    if (IsDragZooming())
-      DragZoom(GetLabelWidth()+1);
+      DragZoom(event, GetLabelWidth()+1);
    else
       DoZoomInOut(event, GetLabelWidth()+1);
 
@@ -2290,12 +2290,16 @@
 
 ///  This actually sets the Zoom value when you're done doing
 ///  a drag zoom.
-void TrackPanel::DragZoom(int trackLeftEdge)
+void TrackPanel::DragZoom(wxMouseEvent & event, int trackLeftEdge)
 {
    double left = PositionToTime(mZoomStart, trackLeftEdge);
    double right = PositionToTime(mZoomEnd, trackLeftEdge);
 
-   mViewInfo->zoom *= mViewInfo->screen / (right - left);
+   if (event.ShiftDown())
+      mViewInfo->zoom /= mViewInfo->screen / (right - left);
+   else
+      mViewInfo->zoom *= mViewInfo->screen / (right - left);
+
    if (mViewInfo->zoom > gMaxZoom)
       mViewInfo->zoom = gMaxZoom;
    if (mViewInfo->zoom <= gMinZoom)

Index: TrackPanel.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/TrackPanel.h,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -d -r1.107 -r1.108
--- TrackPanel.h        20 Aug 2006 09:00:54 -0000      1.107
+++ TrackPanel.h        22 Oct 2006 19:34:18 -0000      1.108
@@ -268,8 +268,8 @@
    void HandleZoomDrag(wxMouseEvent & event);
    void HandleZoomButtonUp(wxMouseEvent & event);
 
-   void DragZoom(int x);
-   void DoZoomInOut(wxMouseEvent &event, int x_center);
+   void DragZoom(wxMouseEvent &event, int x);
+   void DoZoomInOut(wxMouseEvent &event, int x);
 
    void HandleVZoom(wxMouseEvent & event);
    void HandleVZoomClick(wxMouseEvent & event);


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to