Fix T51761: wpaint select depth limit fails
authorCampbell Barton <ideasman42@gmail.com>
Tue, 11 Jul 2017 04:05:59 +0000 (14:05 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 11 Jul 2017 04:05:59 +0000 (14:05 +1000)
Limit select fails with circle and border select.

Regression in 2.76

source/blender/editors/space_view3d/drawobject.c

index 3f11703973dda1a6f01cdce7cd9f3ac51f7c6151..73fd77db4776be7e830109a6efe8425a34121fc0 100644 (file)
@@ -8378,9 +8378,13 @@ static void bbs_mesh_solid_verts(Scene *scene, Object *ob)
 
        DM_update_materials(dm, ob);
 
-       dm->drawMappedFaces(dm, bbs_mesh_solid_hide2__setDrawOpts, GPU_object_material_bind, NULL, me, DM_DRAW_SKIP_HIDDEN);
+       /* Only draw faces to mask out verts, we don't want their selection ID's. */
+       const int G_f_orig = G.f;
+       G.f &= ~G_BACKBUFSEL;
 
-       GPU_object_material_unbind();
+       dm->drawMappedFaces(dm, bbs_mesh_solid_hide2__setDrawOpts, NULL, NULL, me, DM_DRAW_SKIP_HIDDEN);
+
+       G.f |= (G_f_orig & G_BACKBUFSEL);
 
        bbs_obmode_mesh_verts(ob, dm, 1);
        bm_vertoffs = me->totvert + 1;