mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-03 17:19:43 +02:00
Bug 1293 - Unable to mouse wheel zoom in beyond end of project
This commit is contained in:
parent
50258c1f21
commit
fc25ce093f
@ -84,9 +84,12 @@ unsigned CommonTrackPanelCell::HandleWheelRotation
|
||||
xx = event.m_x;
|
||||
center_h = viewInfo.PositionToTime(xx, trackLeftEdge);
|
||||
}
|
||||
|
||||
// Time corresponding to last (most far right) audio.
|
||||
double audioEndTime = pProject->GetTracks()->GetEndTime();
|
||||
|
||||
// Disabled this code to fix Bug 1923 (tricky to wheel-zoom right of waveform).
|
||||
#if 0
|
||||
// When zooming in in empty space, it's easy to 'lose' the waveform.
|
||||
// This prevents it.
|
||||
// IF zooming in
|
||||
@ -97,12 +100,20 @@ unsigned CommonTrackPanelCell::HandleWheelRotation
|
||||
// Zooming brings far right of audio to mouse.
|
||||
center_h = audioEndTime;
|
||||
}
|
||||
#endif
|
||||
|
||||
wxCoord xTrackEnd = viewInfo.TimeToPosition( audioEndTime );
|
||||
viewInfo.ZoomBy(pow(2.0, steps));
|
||||
|
||||
double new_center_h = viewInfo.PositionToTime(xx, trackLeftEdge);
|
||||
viewInfo.h += (center_h - new_center_h);
|
||||
|
||||
// If wave has gone off screen, bring it back.
|
||||
// This means that the end of the track stays where it was.
|
||||
if( viewInfo.h > audioEndTime )
|
||||
viewInfo.h += audioEndTime - viewInfo.PositionToTime( xTrackEnd );
|
||||
|
||||
|
||||
result |= FixScrollbars;
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user