diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2019-09-27 17:43:31 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2019-09-27 17:43:31 +0300 |
commit | c69a771851d8c0504927e4e2b61c608338ae522f (patch) | |
tree | a9da716c5f85b084d9f0c24203355372dd90de69 | |
parent | df3891ed817ff7b4bc8ba1c4c313f0fc2df8eb1f (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.
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 3 |
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) { |