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:
authorAntonioya <blendergit@gmail.com>2019-03-29 14:51:46 +0300
committerAntonioya <blendergit@gmail.com>2019-03-29 14:51:46 +0300
commit800aeaba72f0ed457c45a1ebfe7d09e3c8c7ba6c (patch)
treed6d016a13298d703c61bee1f71dddfd7d82a53b4 /source/blender/editors/gpencil
parent7fc7e325efbb1ccab181e32873f3ad49ed42755d (diff)
GPencil: Cleanup code
Reduce double function calling.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index cd17f7dc640..eece759035f 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1559,20 +1559,24 @@ static void gp_stroke_eraser_dostroke(tGPsdata *p,
if (eraser->gpencil_settings->eraser_mode == GP_BRUSH_ERASER_SOFT) {
float f_strength = eraser->gpencil_settings->era_strength_f / 100.0f;
float f_thickness = eraser->gpencil_settings->era_thickness_f / 100.0f;
+ float influence = 0.0f;
if (pt0) {
- pt0->strength -= gp_stroke_eraser_calc_influence(p, mval, radius, pc0) * strength * f_strength * 0.5f;
+ influence = gp_stroke_eraser_calc_influence(p, mval, radius, pc0);
+ pt0->strength -= influence * strength * f_strength * 0.5f;
CLAMP_MIN(pt0->strength, 0.0f);
- pt0->pressure -= gp_stroke_eraser_calc_influence(p, mval, radius, pc0) * strength * f_thickness * 0.5f;
+ pt0->pressure -= influence * strength * f_thickness * 0.5f;
}
- pt1->strength -= gp_stroke_eraser_calc_influence(p, mval, radius, pc1) * strength * f_strength;
+ influence = gp_stroke_eraser_calc_influence(p, mval, radius, pc1);
+ pt1->strength -= influence * strength * f_strength;
CLAMP_MIN(pt1->strength, 0.0f);
- pt1->pressure -= gp_stroke_eraser_calc_influence(p, mval, radius, pc1) * strength * f_thickness;
+ pt1->pressure -= influence * strength * f_thickness;
- pt2->strength -= gp_stroke_eraser_calc_influence(p, mval, radius, pc2) * strength * f_strength * 0.5f;
+ influence = gp_stroke_eraser_calc_influence(p, mval, radius, pc2);
+ pt2->strength -= influence * strength * f_strength * 0.5f;
CLAMP_MIN(pt2->strength, 0.0f);
- pt2->pressure -= gp_stroke_eraser_calc_influence(p, mval, radius, pc2) * strength * f_thickness * 0.5f;
+ pt2->pressure -= influence * strength * f_thickness * 0.5f;
/* if invisible, delete point */
if ((pt0) &&