1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-08 16:11:14 +02:00

Disable scrollwheel when there are no tracks. (Used to change the time ruler.)

This commit is contained in:
Paul Licameli 2015-05-26 11:28:35 -04:00
parent 2c7c0eb0b6
commit e9830e727b

View File

@ -6196,6 +6196,12 @@ void TrackPanel::HandleResize(wxMouseEvent & event)
/// Handle mouse wheel rotation (for zoom in/out, vertical and horizontal scrolling) /// Handle mouse wheel rotation (for zoom in/out, vertical and horizontal scrolling)
void TrackPanel::HandleWheelRotation(wxMouseEvent & event) 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 / double steps = event.m_wheelRotation /
(event.m_wheelDelta > 0 ? (double)event.m_wheelDelta : 120.0); (event.m_wheelDelta > 0 ? (double)event.m_wheelDelta : 120.0);