diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2019-06-03 10:58:48 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2019-06-03 11:00:38 +0300 |
commit | ccc7ebf7b1bb5ba422efc8112d2c586a0b80af92 (patch) | |
tree | 319c414dd243e866343a5bc1581bf1a873e8d8f1 /source/blender/editors/gpencil | |
parent | 3041705c5188493e66ca25b597f2b15a1b32c0ca (diff) |
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.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_brush.c | 14 |
1 files changed, 9 insertions, 5 deletions
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; |