diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-12-14 17:20:28 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-12-14 18:17:29 +0300 |
commit | e4b3fe4b690689357f81e58442d9bdf77e502124 (patch) | |
tree | 29cda2e7655cd032455f999b65a2f8b37b6e1289 /source/blender/draw | |
parent | f37e45c26b4a528e3f023152924199aa26424a12 (diff) |
Wireframe: Fix wireframe color in edit mode for surfaces
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/intern/draw_common.c | 8 | ||||
-rw-r--r-- | source/blender/draw/modes/overlay_mode.c | 7 |
2 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c index 35f060bd3ba..837b6e5d051 100644 --- a/source/blender/draw/intern/draw_common.c +++ b/source/blender/draw/intern/draw_common.c @@ -878,9 +878,11 @@ int DRW_object_wire_theme_get(Object *ob, ViewLayer *view_layer, float **r_color * note: no theme yet for 'colindex' */ int theme_id = is_edit ? TH_WIRE_EDIT : TH_WIRE; - if (//(scene->obedit == NULL) && - ((G.moving & G_TRANSFORM_OBJ) != 0) && - ((ob->base_flag & BASE_SELECTED) != 0)) + if (is_edit) { + /* fallback to TH_WIRE */ + } + else if (((G.moving & G_TRANSFORM_OBJ) != 0) && + ((ob->base_flag & BASE_SELECTED) != 0)) { theme_id = TH_TRANSFORM; } diff --git a/source/blender/draw/modes/overlay_mode.c b/source/blender/draw/modes/overlay_mode.c index b70a881f6fd..0c67263bd4f 100644 --- a/source/blender/draw/modes/overlay_mode.c +++ b/source/blender/draw/modes/overlay_mode.c @@ -223,6 +223,7 @@ static void overlay_cache_populate(void *vedata, Object *ob) (ob->dtx & OB_DRAWWIRE) || (ob->dt == OB_WIRE)) { + const bool is_edit_mode = BKE_object_is_in_editmode(ob); bool has_edit_mesh_cage = false; if (ob->type == OB_MESH) { /* TODO: Should be its own function. */ @@ -234,7 +235,7 @@ static void overlay_cache_populate(void *vedata, Object *ob) } /* Don't do that in edit Mesh mode, unless there is a modifier preview. */ - if ((((ob != draw_ctx->object_edit) && !BKE_object_is_in_editmode(ob)) || has_edit_mesh_cage) || + if ((((ob != draw_ctx->object_edit) && !is_edit_mode) || has_edit_mesh_cage) || ob->type != OB_MESH) { const bool is_active = (ob == draw_ctx->obact); @@ -265,7 +266,9 @@ static void overlay_cache_populate(void *vedata, Object *ob) struct GPUBatch *geom = DRW_cache_object_face_wireframe_get(ob); if (geom || is_sculpt_mode) { float *rim_col = ts.colorWire; - if (!is_sculpt_mode && !has_edit_mesh_cage && ((ob->base_flag & BASE_SELECTED) != 0)) { + 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; |