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:48:26 +0300
committerAntonio Vazquez <blendergit@gmail.com>2022-01-12 10:45:57 +0300
commit795cea2cce3bcfaa7489034a90722ee57cb8e358 (patch)
treea66dde23c991d0eeeaea301b64fdeaf3b7d4f30e
parent7f28084e2a94da3ea8952b8e355fe672be3f53d1 (diff)
Revert "Cleanup GPencil strength previous commit"
This reverts commit e339946515b00bc230bad2ec52a729dd914a8af3. This broken the tablet pressure and it was impossible to set a proper strength.
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 0b713af54ae..79dda480a0a 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -835,7 +835,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, brush_settings->draw_strength, 1.0f);
+ CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, brush_settings->draw_strength), 1.0f);
}
/* Set vertex colors for buffer. */
@@ -1031,7 +1031,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
/* copy pressure and time */
pt->pressure = ptc->pressure;
pt->strength = ptc->strength;
- CLAMP(pt->strength, brush_settings->draw_strength, 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. */
@@ -1065,7 +1065,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
/* copy pressure and time */
pt->pressure = ptc->pressure;
pt->strength = ptc->strength;
- CLAMP(pt->strength, brush_settings->draw_strength, 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);
@@ -1190,7 +1190,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
/* copy pressure and time */
pt->pressure = ptc->pressure;
pt->strength = ptc->strength;
- CLAMP(pt->strength, brush_settings->draw_strength, 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;