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>2022-01-12 00:45:21 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2022-01-17 16:08:30 +0300
commitccb2456df6d4aa5113146e57e32be46f648d0efa (patch)
tree46c7c782650870ba14a636862019a93c11e0c63e
parent8b749260fbeb1b2d0b1d462eeacd29a175621dfd (diff)
Fix T94799: GPencil Strokes drawn at 0.0 Strength still visible
There was a clamp with a value greater than 0.
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 1a59eba803d..8d16a275335 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -840,7 +840,7 @@ static short gpencil_stroke_addpoint(tGPsdata *p,
/* color strength */
if (brush_settings->flag & GP_BRUSH_USE_STRENGTH_PRESSURE) {
pt->strength *= BKE_curvemapping_evaluateF(brush_settings->curve_strength, 0, pressure);
- CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
+ CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, brush_settings->draw_strength), 1.0f);
}
/* Set vertex colors for buffer. */
@@ -934,6 +934,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
tGPspoint *ptc;
MDeformVert *dvert = NULL;
Brush *brush = p->brush;
+ BrushGpencilSettings *brush_settings = brush->gpencil_settings;
ToolSettings *ts = p->scene->toolsettings;
Depsgraph *depsgraph = p->depsgraph;
Object *obact = (Object *)p->ownerPtr.data;
@@ -1025,7 +1026,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
/* copy pressure and time */
pt->pressure = ptc->pressure;
pt->strength = ptc->strength;
- CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
+ CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, brush_settings->draw_strength), 1.0f);
copy_v4_v4(pt->vert_color, ptc->vert_color);
pt->time = ptc->time;
/* Apply the vertex color to point. */
@@ -1059,7 +1060,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
/* copy pressure and time */
pt->pressure = ptc->pressure;
pt->strength = ptc->strength;
- CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
+ CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, brush_settings->draw_strength), 1.0f);
pt->time = ptc->time;
/* Apply the vertex color to point. */
ED_gpencil_point_vertex_color_set(ts, brush, pt, ptc);
@@ -1182,7 +1183,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
/* copy pressure and time */
pt->pressure = ptc->pressure;
pt->strength = ptc->strength;
- CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
+ CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, brush_settings->draw_strength), 1.0f);
copy_v4_v4(pt->vert_color, ptc->vert_color);
pt->time = ptc->time;
pt->uv_fac = ptc->uv_fac;