Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / space_view3d / drawobject.c
index 08ef9cc21cb1ef140accfda3d62f1cbf8cc9df2f..c1e45f8280f532e15d15a1482af8d33f56f00eba 100644 (file)
@@ -9769,8 +9769,9 @@ void draw_object_backbufsel(
                                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);
 
@@ -9779,6 +9780,10 @@ void draw_object_backbufsel(
                                        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) {