Fix T79309: Safe Areas are not visible

This commit is contained in:
Campbell Barton 2020-08-06 18:28:22 +10:00
parent d4804f00fb
commit c872e87bd4
Notes: blender-bot 2023-06-21 19:23:24 +02:00
Referenced by issue #79309, Safe Areas are not visible
3 changed files with 13 additions and 1 deletions

View File

@ -668,7 +668,8 @@ static void drawviewborder(Scene *scene, Depsgraph *depsgraph, ARegion *region,
/* safety border */
if (ca) {
immUniformThemeColorBlend(TH_VIEW_OVERLAY, TH_BACK, 0.25f);
GPU_blend(true);
immUniformThemeColorAlpha(TH_VIEW_OVERLAY, 0.75f);
if (ca->dtx & CAM_DTX_CENTER) {
float x3, y3;
@ -778,6 +779,8 @@ static void drawviewborder(Scene *scene, Depsgraph *depsgraph, ARegion *region,
* 2.0f round corner effect was nearly not visible anyway... */
imm_draw_box_wire_2d(shdr_pos, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
}
GPU_blend(false);
}
immUnbindProgram();

View File

@ -141,6 +141,7 @@ void immBindBuiltinProgram(eGPUBuiltinShader shader_id);
/* Extend immUniformColor to take Blender's themes */
void immUniformThemeColor(int color_id);
void immUniformThemeColorAlpha(int color_id, float a);
void immUniformThemeColor3(int color_id);
void immUniformThemeColorShade(int color_id, int offset);
void immUniformThemeColorShadeAlpha(int color_id, int color_offset, int alpha_offset);

View File

@ -934,6 +934,14 @@ void immUniformThemeColor(int color_id)
immUniformColor4fv(color);
}
void immUniformThemeColorAlpha(int color_id, float a)
{
float color[4];
UI_GetThemeColor3fv(color_id, color);
color[3] = a;
immUniformColor4fv(color);
}
void immUniformThemeColor3(int color_id)
{
float color[3];