From e1100adc43f39a1aab083694d0ea89a6a3306d32 Mon Sep 17 00:00:00 2001 From: Kevin M Date: Sat, 4 Mar 2023 01:19:06 -0800 Subject: [PATCH] returning without zooming with the new 65535 check for zooming actually caused inconsistent zoom behavior at the max zoom on some images, so, undo the change so it only checks when the sizes are the same --- src/JPEGView/MainDlg.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/JPEGView/MainDlg.cpp b/src/JPEGView/MainDlg.cpp index 047251eb..e4036abd 100644 --- a/src/JPEGView/MainDlg.cpp +++ b/src/JPEGView/MainDlg.cpp @@ -2654,14 +2654,7 @@ void CMainDlg::PerformZoom(double dValue, bool bExponent, bool bZoomToMouse, boo #endif // because we've increased/decreased to the maximum zoom allowed, - // only actually perform the zoom if the old and new dimensions differ, - // or at the edge of allowable max dimension (maximum 65535 pixels) - if (nNewXSize == 65535 || nNewYSize == 65535) { - // zooming in does not require restoring the previous zoom value - // because the code which checks the 65535 will re-scale the zoom factor to ensure it never exceeds 65535 - return; - } - + // only actually perform the zoom if the old and new dimensions differ // the float arithmetic doesn't always come up with the same answer, but the new sizes can be directly compared if (nNewXSize == nOldXSize && nNewYSize == nOldYSize) { // because there's rounding errors, it is possible to get stuck zooming out from fractional zoom, @@ -2675,6 +2668,8 @@ void CMainDlg::PerformZoom(double dValue, bool bExponent, bool bZoomToMouse, boo // NOTE: this gets triggered on pauseAtZoom m_dZoom = dOldZoom; // restore previous zoom value } + // zooming in does not require restoring the previous zoom value + // because the code which checks the 65535 will re-scale the zoom factor to ensure it never exceeds 65535 return; // then do nothing }