From e9830e727b6210b7496c8120c597361131306cb4 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Tue, 26 May 2015 11:28:35 -0400 Subject: [PATCH] Disable scrollwheel when there are no tracks. (Used to change the time ruler.) --- src/TrackPanel.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index a820c9c86..e3d82c4bb 100755 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -6196,6 +6196,12 @@ void TrackPanel::HandleResize(wxMouseEvent & event) /// Handle mouse wheel rotation (for zoom in/out, vertical and horizontal scrolling) void TrackPanel::HandleWheelRotation(wxMouseEvent & event) { + if (GetTracks()->IsEmpty()) + // Scrolling and Zoom in and out commands are disabled when there are no tracks. + // This should be disabled too for consistency. Otherwise + // you do see changes in the time ruler. + return; + double steps = event.m_wheelRotation / (event.m_wheelDelta > 0 ? (double)event.m_wheelDelta : 120.0);