@@ -2015,7 +2015,7 @@ ImageViewer::zoomIn(bool smooth)
20152015 float current_zoom = zoom ();
20162016 if (current_zoom >= 64 )
20172017 return ;
2018-
2018+
20192019 float newzoom = ceil2f (current_zoom);
20202020
20212021 this ->zoomToCursor (newzoom, smooth);
@@ -2028,11 +2028,11 @@ ImageViewer::zoomOut(bool smooth)
20282028 IvImage* img = cur ();
20292029 if (!img)
20302030 return ;
2031-
2031+
20322032 float current_zoom = zoom ();
20332033 if (current_zoom <= 1 .0f / 64 )
20342034 return ;
2035-
2035+
20362036 float newzoom = floor2f (current_zoom);
20372037
20382038 this ->zoomToCursor (newzoom, smooth);
@@ -2051,10 +2051,11 @@ ImageViewer::zoomToCursor(float newzoom, bool smooth)
20512051 float yoffset = yc - ym;
20522052
20532053 float maxzoomratio = std::max (oldzoom / newzoom, newzoom / oldzoom);
2054- int nsteps = smooth ? (int )OIIO::clamp (20 * (maxzoomratio - 1 ), 2 .0f , 10 .0f ) : 1 ;
2054+ int nsteps = smooth ? (int )OIIO::clamp (20 * (maxzoomratio - 1 ), 2 .0f , 10 .0f )
2055+ : 1 ;
20552056 for (int i = 1 ; i <= nsteps; ++i) {
2056- float a = (float )i / (float )nsteps; // Interpolation amount
2057- float z = OIIO::lerp (oldzoom, newzoom, a);
2057+ float a = (float )i / (float )nsteps; // Interpolation amount
2058+ float z = OIIO::lerp (oldzoom, newzoom, a);
20582059 float zoomratio = z / oldzoom;
20592060 view (xm + xoffset / zoomratio, ym + yoffset / zoomratio, z, false );
20602061 if (i != nsteps) {
0 commit comments