1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-06 14:52:34 +02:00

Removed ZoomInfo::GetZoom() which I added in my previous commit

Just wasn't thinking.
This commit is contained in:
David Bailes 2017-04-06 13:31:04 +01:00
parent 1fa97a4b37
commit fc2628de4d
2 changed files with 5 additions and 11 deletions

View File

@ -5682,15 +5682,12 @@ void AudacityProject::OnZoomThousandthSecond()
void AudacityProject::OnZoomPreset(double newZoom) void AudacityProject::OnZoomPreset(double newZoom)
{ {
double currentZoom = mViewInfo.GetZoom(); double zoomFactor = newZoom * mViewInfo.OffsetTimeByPixels(0.0, 1);
if (currentZoom != 0.0) { if (zoomFactor > 1.0 )
double ratio = newZoom/currentZoom; ZoomInByFactor(zoomFactor);
if (ratio > 1.0 ) else if (zoomFactor < 1.0)
ZoomInByFactor(ratio); ZoomOutByFactor(zoomFactor);
else if (ratio < 1.0)
ZoomOutByFactor(ratio);
}
} }
void AudacityProject::OnZoomFit() void AudacityProject::OnZoomFit()

View File

@ -86,9 +86,6 @@ public:
// There is NO GetZoom()! // There is NO GetZoom()!
// Use TimeToPosition and PositionToTime and OffsetTimeByPixels! // Use TimeToPosition and PositionToTime and OffsetTimeByPixels!
// DB added GetZoom() - needed for zoom presets.
double GetZoom() const {return zoom; }
// Limits zoom to certain bounds // Limits zoom to certain bounds
void SetZoom(double pixelsPerSecond); void SetZoom(double pixelsPerSecond);