Fix T46426: 2D-version of zoom border operator is available in 3DView context.

This commit is contained in:
Bastien Montagne 2015-10-09 22:24:58 +02:00
parent 165c87dc4f
commit db3dfb76a8
Notes: blender-bot 2023-02-14 08:33:28 +01:00
Referenced by issue #46426, Zoom Border vs Zoom to border
1 changed files with 8 additions and 3 deletions

View File

@ -612,15 +612,20 @@ static int view_zoom_poll(bContext *C)
/* check if there's a region in context to work with */
if (ar == NULL)
return 0;
return false;
/* Do not show that in 3DView context. */
if (CTX_wm_region_view3d(C))
return false;
v2d = &ar->v2d;
/* check that 2d-view is zoomable */
if ((v2d->keepzoom & V2D_LOCKZOOM_X) && (v2d->keepzoom & V2D_LOCKZOOM_Y))
return 0;
return false;
/* view is zoomable */
return 1;
return true;
}
/* apply transform to view (i.e. adjust 'cur' rect) */