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-09-27 17:43:31 +0300
committerAntonio Vazquez <blendergit@gmail.com>2019-09-27 17:43:31 +0300
commitc69a771851d8c0504927e4e2b61c608338ae522f (patch)
treea9da716c5f85b084d9f0c24203355372dd90de69 /source/blender/editors/gpencil
parentdf3891ed817ff7b4bc8ba1c4c313f0fc2df8eb1f (diff)
GPencil: Simplify smooth average factor calculation
As always uses 4 points, don't need to do calculations for that and also it was wrong with 3 points.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index bf87408d38f..d8f1663a6c1 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -650,7 +650,7 @@ static void gp_smooth_segment(bGPdata *gpd, const float inf, int from_idx, int t
}
tGPspoint *points = (tGPspoint *)gpd->runtime.sbuffer;
- const float steps = (num_points < 4) ? 3.0f : 4.0f;
+ const float average_fac = 0.25f;
for (int i = from_idx; i < to_idx + 1; i++) {
@@ -660,7 +660,6 @@ static void gp_smooth_segment(bGPdata *gpd, const float inf, int from_idx, int t
tGPspoint *ptd = &points[i];
float sco[2] = {0.0f};
- const float average_fac = 1.0f / steps;
/* Compute smoothed coordinate by taking the ones nearby */
if (pta) {