Fix UV shadow drawing not respecting 'UV Opacity' setting

reapply changes from 30cbbccc60 / D7764 that were only meant for
master. Sorry for the noise!
This commit is contained in:
Philipp Oeser 2020-05-19 15:33:21 +02:00
parent a95afed6de
commit 46c35dc283
1 changed files with 8 additions and 0 deletions

View File

@ -223,6 +223,7 @@ static void draw_uvs_shadow(SpaceImage *sima,
{
Object *ob_eval = DEG_get_evaluated_object(depsgraph, obedit);
Mesh *me = ob_eval->data;
const float overlay_alpha = sima->uv_opacity;
float col[4];
UI_GetThemeColor4fv(TH_UV_SHADOW, col);
@ -235,7 +236,11 @@ static void draw_uvs_shadow(SpaceImage *sima,
GPU_line_smooth(true);
GPU_blend(true);
}
else if (overlay_alpha < 1.0f) {
GPU_blend(true);
}
col[3] = overlay_alpha;
GPU_batch_program_set_builtin(edges, GPU_SHADER_2D_UV_UNIFORM_COLOR);
GPU_batch_uniform_4fv(edges, "color", col);
GPU_batch_draw(edges);
@ -244,6 +249,9 @@ static void draw_uvs_shadow(SpaceImage *sima,
GPU_line_smooth(false);
GPU_blend(false);
}
else if (overlay_alpha < 1.0f) {
GPU_blend(false);
}
}
}