diff --git a/source/blender/draw/engines/overlay/overlay_next_wireframe.hh b/source/blender/draw/engines/overlay/overlay_next_wireframe.hh index 6adb4bd4e04..91a8a2e9404 100644 --- a/source/blender/draw/engines/overlay/overlay_next_wireframe.hh +++ b/source/blender/draw/engines/overlay/overlay_next_wireframe.hh @@ -161,7 +161,11 @@ class Wireframe : Overlay { break; } case OB_MESH: { - bool has_edit_cage = Meshes::mesh_has_edit_cage(ob_ref.object); + /* Force display in edit mode when overlay is off in wireframe mode (see #78484). */ + const bool wireframe_no_overlay = state.hide_overlays && state.is_wireframe_mode; + /* Display only if there is an edit cage. Otherwise we get Z fighting with edit wires. */ + const bool has_edit_cage = Meshes::mesh_has_edit_cage(ob_ref.object); + const bool bypass_mode_check = wireframe_no_overlay || has_edit_cage; if (show_surface_wire) { if (BKE_sculptsession_use_pbvh_draw(ob_ref.object, state.rv3d)) { @@ -171,7 +175,7 @@ class Wireframe : Overlay { coloring.mesh_all_edges_ps_->draw(batch.batch, handle); } } - else if (!in_edit_mode || has_edit_cage) { + else if (!in_edit_mode || bypass_mode_check) { /* Only draw the wireframe in edit mode if object has edit cage. * Otherwise the wireframe will conflict with the edit cage drawing and produce * unpleasant aliasing. */ @@ -182,7 +186,7 @@ class Wireframe : Overlay { } /* Draw loose geometry. */ - if (!in_edit_paint_mode || has_edit_cage) { + if (!in_edit_paint_mode || bypass_mode_check) { const Mesh *mesh = static_cast(ob_ref.object->data); gpu::Batch *geom; if ((mesh->edges_num == 0) && (mesh->verts_num > 0)) {