From ccc7ebf7b1bb5ba422efc8112d2c586a0b80af92 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Mon, 3 Jun 2019 09:58:48 +0200 Subject: Fix T65408: GPencil Weight Paint, strength and falloff are ignored when painting a lesser vertexweight The value was clamped to minimum value before checking the influence. --- source/blender/editors/gpencil/gpencil_brush.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/gpencil') diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index 915af337b86..7e871e03b99 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -922,17 +922,21 @@ static bool gp_brush_weight_apply( float curweight = dw ? dw->weight : 0.0f; if (gp_brush_invert_check(gso)) { - /* reduce weight */ - curweight -= inf; + /* reduce weight (verify mainimum target) */ + if (curweight - inf < gso->gp_brush->weight) { + curweight = gso->gp_brush->weight; + } + else { + curweight -= inf; + } } else { /* increase weight */ curweight += inf; + /* verify maximum target weight */ + CLAMP_MAX(curweight, gso->gp_brush->weight); } - /* verify target weight */ - CLAMP_MAX(curweight, gso->gp_brush->weight); - CLAMP(curweight, 0.0f, 1.0f); if (dw) { dw->weight = curweight; -- cgit v1.2.3