diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/draw/engines/basic/basic_engine.c | 1 | ||||
-rw-r--r-- | source/blender/draw/modes/overlay_mode.c | 15 |
2 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/draw/engines/basic/basic_engine.c b/source/blender/draw/engines/basic/basic_engine.c index 9dc8c8f2f34..eea41c932e2 100644 --- a/source/blender/draw/engines/basic/basic_engine.c +++ b/source/blender/draw/engines/basic/basic_engine.c @@ -141,6 +141,7 @@ static void basic_cache_populate(void *vedata, Object *ob) /* Make flat object selectable in ortho view if wireframe is enabled. */ if ((draw_ctx->v3d->overlay.flag & V3D_OVERLAY_WIREFRAMES) || + (draw_ctx->v3d->shading.type == OB_WIRE) || (ob->dtx & OB_DRAWWIRE) || (ob->dt == OB_WIRE)) { diff --git a/source/blender/draw/modes/overlay_mode.c b/source/blender/draw/modes/overlay_mode.c index 0c67263bd4f..7060c1c9704 100644 --- a/source/blender/draw/modes/overlay_mode.c +++ b/source/blender/draw/modes/overlay_mode.c @@ -174,7 +174,6 @@ static void overlay_cache_init(void *vedata) psl->face_wireframe_pass = DRW_pass_create("Face Wires", state); g_data->flat_wires = DRW_shgroup_create(flat_wires_sh, psl->face_wireframe_pass); - DRW_shgroup_uniform_vec4(g_data->flat_wires, "color", ts.colorWire, 1); g_data->sculpt_wires = DRW_shgroup_create(sculpt_wire_sh, psl->face_wireframe_pass); @@ -246,6 +245,13 @@ static void overlay_cache_populate(void *vedata, Object *ob) const int stencil_mask = (ob->dtx & OB_DRAWXRAY) ? 0x00 : 0xFF; DRWShadingGroup *shgrp = NULL; + float *rim_col = ts.colorWire; + if (!is_edit_mode && !is_sculpt_mode && !has_edit_mesh_cage && + ((ob->base_flag & BASE_SELECTED) != 0)) + { + rim_col = (ob == draw_ctx->obact) ? ts.colorActive : ts.colorSelect; + } + /* This fixes only the biggest case which is a plane in ortho view. */ int flat_axis = 0; bool is_flat_object_viewed_from_side = (rv3d->persp == RV3D_ORTHO) && @@ -260,17 +266,12 @@ static void overlay_cache_populate(void *vedata, Object *ob) shgrp = DRW_shgroup_create_sub(shgrp); DRW_shgroup_stencil_mask(shgrp, stencil_mask); DRW_shgroup_call_object_add(shgrp, geom, ob); + DRW_shgroup_uniform_vec4(shgrp, "color", rim_col, 1); } } else { struct GPUBatch *geom = DRW_cache_object_face_wireframe_get(ob); if (geom || is_sculpt_mode) { - float *rim_col = ts.colorWire; - if (!is_edit_mode && !is_sculpt_mode && !has_edit_mesh_cage && - ((ob->base_flag & BASE_SELECTED) != 0)) - { - rim_col = (ob == draw_ctx->obact) ? ts.colorActive : ts.colorSelect; - } shgrp = (is_sculpt_mode) ? pd->sculpt_wires : pd->face_wires; shgrp = DRW_shgroup_create_sub(shgrp); |