Fix T46426: 2D-version of zoom border operator is available in 3DView context.
authorBastien Montagne <montagne29@wanadoo.fr>
Fri, 9 Oct 2015 20:24:58 +0000 (22:24 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Fri, 9 Oct 2015 20:24:58 +0000 (22:24 +0200)
source/blender/editors/interface/view2d_ops.c

index 07275d6be2a95bfda90a50932a5fd1acf98cf49d..ca1efb82ae96c4c1d35489de03c78e28d7849d5b 100644 (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) */