fix [#36861] In face select masking circle select selects all when out of focus.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 30 Sep 2013 07:58:38 +0000 (07:58 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 30 Sep 2013 07:58:38 +0000 (07:58 +0000)
source/blender/editors/mesh/editmesh_select.c
source/blender/editors/space_view3d/view3d_select.c

index 806ae96cb61b57645e61ae749f8549ca2bf0a8ef..76c08433b25b5f16a9bff5e38324dd366f27cebc 100644 (file)
@@ -266,6 +266,7 @@ bool EDBM_backbuf_border_init(ViewContext *vc, short xmin, short ymin, short xma
 
 int EDBM_backbuf_check(unsigned int index)
 {
+       BLI_assert(selbuf != NULL);
        if (selbuf == NULL) return 1;
        if (index > 0 && index <= bm_vertoffs)
                return selbuf[index];
index c812f1084e26a8b8e44e6170d7861d7c312b2772..8553791e229ab8d38de513020f741edacfe4f702 100644 (file)
@@ -2406,12 +2406,12 @@ static void paint_facesel_circle_select(ViewContext *vc, const bool select, cons
 {
        Object *ob = vc->obact;
        Mesh *me = ob ? ob->data : NULL;
-       /* int bbsel; */ /* UNUSED */
+       bool bbsel;
 
-       if (me) {
-               bm_vertoffs = me->totpoly + 1; /* max index array */
+       bm_vertoffs = me->totpoly + 1; /* max index array */
 
-               /* bbsel = */ /* UNUSED */ EDBM_backbuf_circle_init(vc, mval[0], mval[1], (short)(rad + 1.0f));
+       bbsel = EDBM_backbuf_circle_init(vc, mval[0], mval[1], (short)(rad + 1.0f));
+       if (bbsel) {
                edbm_backbuf_check_and_select_tfaces(me, select);
                EDBM_backbuf_free();
                paintface_flush_flags(ob);
@@ -2431,15 +2431,17 @@ static void paint_vertsel_circle_select(ViewContext *vc, const bool select, cons
        const int use_zbuf = (vc->v3d->flag & V3D_ZBUF_SELECT);
        Object *ob = vc->obact;
        Mesh *me = ob->data;
-       /* int bbsel; */ /* UNUSED */
+       bool bbsel;
        /* CircleSelectUserData data = {NULL}; */ /* UNUSED */
 
        if (use_zbuf) {
                bm_vertoffs = me->totvert + 1; /* max index array */
 
-               /* bbsel = */ /* UNUSED */ EDBM_backbuf_circle_init(vc, mval[0], mval[1], (short)(rad + 1.0f));
-               edbm_backbuf_check_and_select_verts_obmode(me, select);
-               EDBM_backbuf_free();
+               bbsel = EDBM_backbuf_circle_init(vc, mval[0], mval[1], (short)(rad + 1.0f));
+               if (bbsel) {
+                       edbm_backbuf_check_and_select_verts_obmode(me, select);
+                       EDBM_backbuf_free();
+               }
        }
        else {
                CircleSelectUserData data;