Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2019-06-03 10:58:48 +0300
committerAntonio Vazquez <blendergit@gmail.com>2019-06-03 11:00:38 +0300
commitccc7ebf7b1bb5ba422efc8112d2c586a0b80af92 (patch)
tree319c414dd243e866343a5bc1581bf1a873e8d8f1 /source/blender/editors/gpencil/gpencil_brush.c
parent3041705c5188493e66ca25b597f2b15a1b32c0ca (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/gpencil_brush.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_brush.c14
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;