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 17:39:29 +0300
committerAntonioya <blendergit@gmail.com>2019-03-29 17:39:47 +0300
commitfb86d0919504b00db2b7f28cf39472d1abca6a90 (patch)
treef13edb0c775e7fee0fbd0896a1eb7b584ff06da9 /source/blender/editors/gpencil
parenta942d8859c047dadabf5bf873b9197cb92c46904 (diff)
GPencil: Improve soft eraser for last stroke points
Now, the last point is managed separately in order to get smoother transition.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index eece759035f..d9a58ddc5a6 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1404,6 +1404,19 @@ static void gp_stroke_soft_refine(bGPDstroke *gps, const float cull_thresh)
}
}
+ /* last point special case to get smoother transition */
+ pt = &gps->points[gps->totpoints - 1];
+ pt_before = &gps->points[gps->totpoints - 2];
+ if (pt->flag & GP_SPOINT_TAG) {
+ pt->flag &= ~GP_SPOINT_TAG;
+ pt->flag &= ~GP_SPOINT_TEMP_TAG;
+ pt->strength = 0.0f;
+
+ pt_before->flag &= ~GP_SPOINT_TAG;
+ pt_before->flag &= ~GP_SPOINT_TEMP_TAG;
+ pt_before->strength *= 0.5f;
+ }
+
/* now untag temp tagged */
pt = gps->points;
for (i = 1; i < gps->totpoints - 1; i++, pt++) {