From 7d56c425f8e64346eac6e78ed49d5c5ce2fe1025 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Fri, 13 Mar 2020 21:54:42 +0100 Subject: GPencil: Don'r Replace color if vertex color is empty The replace tools only must work over previously vertex painted. --- source/blender/editors/gpencil/gpencil_vertex_paint.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/source/blender/editors/gpencil/gpencil_vertex_paint.c b/source/blender/editors/gpencil/gpencil_vertex_paint.c index 9cdea22d45e..45dc22bafba 100644 --- a/source/blender/editors/gpencil/gpencil_vertex_paint.c +++ b/source/blender/editors/gpencil/gpencil_vertex_paint.c @@ -484,19 +484,15 @@ static bool brush_replace_apply(tGP_BrushVertexpaintData *gso, bGPDstroke *gps, /* Apply color to Stroke point. */ if (GPENCIL_TINT_VERTEX_COLOR_STROKE(brush)) { - copy_v3_v3(pt->vert_color, gso->linear_color); - /* If not mix color, full replace. */ - if (pt->vert_color[3] == 0.0f) { - pt->vert_color[3] = 1.0f; + if (pt->vert_color[3] > 0.0f) { + copy_v3_v3(pt->vert_color, gso->linear_color); } } /* Apply color to Fill area (all with same color and factor). */ if (GPENCIL_TINT_VERTEX_COLOR_FILL(brush)) { - copy_v3_v3(gps->vert_color_fill, gso->linear_color); - /* If not mix color, full replace. */ - if (gps->vert_color_fill[3] == 0.0f) { - gps->vert_color_fill[3] = 1.0f; + if (gps->vert_color_fill[3] > 0.0f) { + copy_v3_v3(gps->vert_color_fill, gso->linear_color); } } -- cgit v1.2.3