From db3dfb76a8c51a7c65ec6da715c9df91b75b68d1 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 9 Oct 2015 22:24:58 +0200 Subject: [PATCH] Fix T46426: 2D-version of zoom border operator is available in 3DView context. --- source/blender/editors/interface/view2d_ops.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 07275d6be2a..ca1efb82ae9 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -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) */