Nodes: Cleanup setting node header alpha

Always draw header opaque, set transparency only once after getting
the color. Helps to unify the color and alpha values.
This commit is contained in:
Pablo Vazquez 2021-10-27 01:24:19 +02:00
parent f195a3a30d
commit 8d8ce64435
Notes: blender-bot 2023-12-08 12:32:11 +01:00
Referenced by issue #93321, Blender 3.0 splash screen scene will rendered incorrectly
Referenced by issue #93092, Incomplete Animation Rendering of MultiLayer EXR composition
Referenced by issue #115899, Regression: Semi-transparent gap between node header and node content
1 changed files with 6 additions and 6 deletions

View File

@ -1625,10 +1625,10 @@ static void node_draw_basis(const bContext *C,
/* Muted nodes get a mix of the background with the node color. */
if (node->flag & NODE_MUTED) {
UI_GetThemeColorBlendShade4fv(TH_BACK, color_id, 0.1f, 0, color_header);
UI_GetThemeColorBlend4f(TH_BACK, color_id, 0.1f, color_header);
}
else {
UI_GetThemeColorBlendShade4fv(TH_NODE, color_id, 0.6f, -40, color_header);
UI_GetThemeColorBlend4f(TH_NODE, color_id, 0.4f, color_header);
}
UI_draw_roundbox_corner_set(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT);
@ -1770,11 +1770,11 @@ static void node_draw_basis(const bContext *C,
{
/* Use warning color to indicate undefined types. */
if (nodeTypeUndefined(node)) {
UI_GetThemeColorBlendShade4fv(TH_REDALERT, color_id, 0.05f, -80, color);
UI_GetThemeColorBlend4f(TH_REDALERT, TH_NODE, 0.4f, color);
}
/* Muted nodes get a mix of the background with the node color. */
else if (node->flag & NODE_MUTED) {
UI_GetThemeColorBlendShade4fv(TH_BACK, TH_NODE, 0.33f, 0, color);
UI_GetThemeColorBlend4f(TH_BACK, TH_NODE, 0.2f, color);
}
else if (node->flag & NODE_CUSTOM_COLOR) {
rgba_float_args_set(color, node->color[0], node->color[1], node->color[2], 1.0f);
@ -1900,7 +1900,7 @@ static void node_draw_hidden(const bContext *C,
{
if (nodeTypeUndefined(node)) {
/* Use warning color to indicate undefined types. */
UI_GetThemeColorBlendShade4fv(TH_REDALERT, color_id, 0.05f, -80, color);
UI_GetThemeColorBlend4f(TH_REDALERT, TH_NODE, 0.4f, color);
}
else if (node->flag & NODE_MUTED) {
/* Muted nodes get a mix of the background with the node color. */
@ -1910,7 +1910,7 @@ static void node_draw_hidden(const bContext *C,
rgba_float_args_set(color, node->color[0], node->color[1], node->color[2], 1.0f);
}
else {
UI_GetThemeColorBlendShade4fv(TH_NODE, color_id, 0.6f, -40, color);
UI_GetThemeColorBlend4f(TH_NODE, color_id, 0.4f, color);
}
/* Draw selected nodes fully opaque. */