From fc2628de4de2eb66532f4014f915909800f1104b Mon Sep 17 00:00:00 2001 From: David Bailes Date: Thu, 6 Apr 2017 13:31:04 +0100 Subject: [PATCH] Removed ZoomInfo::GetZoom() which I added in my previous commit Just wasn't thinking. --- src/Menus.cpp | 13 +++++-------- src/ViewInfo.h | 3 --- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/Menus.cpp b/src/Menus.cpp index 787cf192c..139374e6b 100644 --- a/src/Menus.cpp +++ b/src/Menus.cpp @@ -5682,15 +5682,12 @@ void AudacityProject::OnZoomThousandthSecond() void AudacityProject::OnZoomPreset(double newZoom) { - double currentZoom = mViewInfo.GetZoom(); + double zoomFactor = newZoom * mViewInfo.OffsetTimeByPixels(0.0, 1); - if (currentZoom != 0.0) { - double ratio = newZoom/currentZoom; - if (ratio > 1.0 ) - ZoomInByFactor(ratio); - else if (ratio < 1.0) - ZoomOutByFactor(ratio); - } + if (zoomFactor > 1.0 ) + ZoomInByFactor(zoomFactor); + else if (zoomFactor < 1.0) + ZoomOutByFactor(zoomFactor); } void AudacityProject::OnZoomFit() diff --git a/src/ViewInfo.h b/src/ViewInfo.h index 0bf7bc2fc..2bffb400f 100644 --- a/src/ViewInfo.h +++ b/src/ViewInfo.h @@ -86,9 +86,6 @@ public: // There is NO GetZoom()! // Use TimeToPosition and PositionToTime and OffsetTimeByPixels! - // DB added GetZoom() - needed for zoom presets. - - double GetZoom() const {return zoom; } // Limits zoom to certain bounds void SetZoom(double pixelsPerSecond);