diff options
author | Antonioya <blendergit@gmail.com> | 2018-09-13 17:52:27 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-09-13 17:52:27 +0300 |
commit | a273e432ccbb510c5dea26f16df61cfc9c747008 (patch) | |
tree | a799a75fbd6fdabae01f0f5ce2647d570699492f /source | |
parent | 03e8de9dae8eebd3c54a076456d58dec813f346e (diff) |
GP: Add pressure button for eraser brushes
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index f65ae8806b4..16c085f1fdb 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1299,6 +1299,7 @@ static bool gp_stroke_eraser_is_occluded(tGPsdata *p, const bGPDspoint *pt, cons /* apply a falloff effect to brush strength, based on distance */ static float gp_stroke_eraser_calc_influence(tGPsdata *p, const int mval[2], const int radius, const int co[2]) { + Brush *brush = p->brush; /* Linear Falloff... */ float distance = (float)len_v2v2_int(mval, co); float fac; @@ -1307,7 +1308,9 @@ static float gp_stroke_eraser_calc_influence(tGPsdata *p, const int mval[2], con fac = 1.0f - (distance / (float)radius); /* Control this further using pen pressure */ - fac *= p->pressure; + if (brush->gpencil_settings->flag & GP_BRUSH_USE_PRESSURE) { + fac *= p->pressure; + } /* Return influence factor computed here */ return fac; |