diff options
author | EitanSomething <eitant13@gmail.com> | 2019-08-16 17:23:02 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-08-16 17:49:04 +0300 |
commit | 42cee6ab213406814aae62ff28845559fbd5f4f1 (patch) | |
tree | e474b84d14e07f18d4ec90b4b4d578ab588786b0 /source/blender/editors/uvedit | |
parent | ea8e0df672713a7b3ff408242c940e1f5e78c9c1 (diff) |
Fix part of T62917: selected edge not highlighted with black and white overlays
Differential Revision: https://developer.blender.org/D5369
Diffstat (limited to 'source/blender/editors/uvedit')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_draw.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index d97714061c0..f485b440692 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -367,33 +367,33 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit, Depsgraph * break; } case SI_UVDT_BLACK: - case SI_UVDT_WHITE: { - GPU_line_width(1.0f); - GPU_batch_program_set_builtin(edges, GPU_SHADER_2D_UNIFORM_COLOR); - if (sima->dt_uv == SI_UVDT_WHITE) { - GPU_batch_uniform_4f(edges, "color", 1.0f, 1.0f, 1.0f, 1.0f); - } - else { - GPU_batch_uniform_4f(edges, "color", 0.0f, 0.0f, 0.0f, 1.0f); - } - GPU_batch_draw(edges); - break; - } + case SI_UVDT_WHITE: case SI_UVDT_OUTLINE: { /* We could modify the vbo's data filling * instead of modifying the provoking vert. */ glProvokingVertex(GL_FIRST_VERTEX_CONVENTION); - UI_GetThemeColor4fv(TH_WIRE_EDIT, col1); UI_GetThemeColor4fv(TH_EDGE_SELECT, col2); GPU_batch_program_set_builtin( edges, (interpedges) ? GPU_SHADER_2D_UV_EDGES_SMOOTH : GPU_SHADER_2D_UV_EDGES); - /* Black Outline. */ - GPU_line_width(3.0f); - GPU_batch_uniform_4f(edges, "edgeColor", 0.0f, 0.0f, 0.0f, 1.0f); - GPU_batch_uniform_4f(edges, "selectColor", 0.0f, 0.0f, 0.0f, 1.0f); - GPU_batch_draw(edges); + + if (sima->dt_uv == SI_UVDT_OUTLINE) { + /* Black Outline. */ + GPU_line_width(3.0f); + GPU_batch_uniform_4f(edges, "edgeColor", 0.0f, 0.0f, 0.0f, 1.0f); + GPU_batch_uniform_4f(edges, "selectColor", 0.0f, 0.0f, 0.0f, 1.0f); + GPU_batch_draw(edges); + + UI_GetThemeColor4fv(TH_WIRE_EDIT, col1); + } + else if (sima->dt_uv == SI_UVDT_WHITE) { + copy_v4_fl4(col1, 1.0f, 1.0f, 1.0f, 1.0f); + } + else { + copy_v4_fl4(col1, 0.0f, 0.0f, 0.0f, 1.0f); + } + /* Inner Line. Use depth test to insure selection is drawn on top. */ GPU_depth_test(true); GPU_line_width(1.0f); |