Fix T49646: Switching from large to small image can get stuck zoom at max zoom distance.

Allow for zooming in at max zoom distance.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D2291
This commit is contained in:
Anthony Edlin 2016-10-14 00:54:05 +02:00 committed by Sergey Sharybin
parent 3fb0c1b8e7
commit e6d9b15ab3
2 changed files with 2 additions and 2 deletions

View File

@ -103,7 +103,7 @@ static void sclip_zoom_set(const bContext *C, float zoom, float location[2])
width *= sc->zoom;
height *= sc->zoom;
if ((width < 4) && (height < 4))
if ((width < 4) && (height < 4) && sc->zoom < oldzoom)
sc->zoom = oldzoom;
else if (BLI_rcti_size_x(&ar->winrct) <= sc->zoom)
sc->zoom = oldzoom;

View File

@ -122,7 +122,7 @@ static void sima_zoom_set(SpaceImage *sima, ARegion *ar, float zoom, const float
width *= sima->zoom;
height *= sima->zoom;
if ((width < 4) && (height < 4))
if ((width < 4) && (height < 4) && sima->zoom < oldzoom)
sima->zoom = oldzoom;
else if (BLI_rcti_size_x(&ar->winrct) <= sima->zoom)
sima->zoom = oldzoom;