1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-14 23:57:40 +02:00

Cancel Snap-To if we are zooming in to sample level.

This commit is contained in:
James Crook 2016-08-28 18:28:49 +01:00
parent c903434908
commit 47eaafb4f7

View File

@ -89,6 +89,16 @@ bool ZoomInfo::ZoomOutAvailable() const
void ZoomInfo::SetZoom(double pixelsPerSecond)
{
zoom = std::max(gMinZoom, std::min(gMaxZoom, pixelsPerSecond));
// Disable snapping if user zooms in a long way.
// Helps stop users be trapped in snap-to.
// The level chosen is in sample viewing range with samples
// still quite close together.
if( zoom > (gMaxZoom * 0.06 ))
{
AudacityProject * project = GetActiveProject();
if( project )
project->OnSnapToOff();
}
}
void ZoomInfo::ZoomBy(double multiplier)