From e6838ecc260441dcba0abfcd8a8292b94081df64 Mon Sep 17 00:00:00 2001 From: Germano Date: Fri, 8 Dec 2017 12:42:00 -0200 Subject: [PATCH] Fix T53512: Vertices with index 0 were not being selected Bug introduced on rB9f5bf197a0c3. The offset for selection of vertices (`bm_vertoffs`) starts where the offset o edges ends (`bm_wireoffs`). However, the `bm_wireoffs` depends on the offset of face selection (`bm_solidoffs`). Before the commit that introduced the bug, the drawn of edges (in backbuff) was always computed along with the `bm_wireoffs`: ``` bm_wireoffs = bm_solidoffs + em->bm->totedge; ``` Now that the edges are not always drawn in backbuff, `bm_wireoffs` has to start from `bm_solidoffs`. --- source/blender/editors/space_view3d/drawobject.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index a1075f7efcf..a1ddec7531e 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -8433,8 +8433,9 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec bbs_mesh_solid_EM(em, scene, v3d, ob, dm, (ts->selectmode & SCE_SELECT_FACE) != 0); if (ts->selectmode & SCE_SELECT_FACE) bm_solidoffs = 1 + em->bm->totface; - else + else { bm_solidoffs = 1; + } ED_view3d_polygon_offset(rv3d, 1.0); @@ -8443,6 +8444,10 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec bbs_mesh_wire(em, dm, bm_solidoffs); bm_wireoffs = bm_solidoffs + em->bm->totedge; } + else { + /* `bm_vertoffs` is calculated from `bm_wireoffs`. (otherwise see T53512) */ + bm_wireoffs = bm_solidoffs; + } /* we draw verts if vert select mode. */ if (ts->selectmode & SCE_SELECT_VERTEX) {