GPencil: Improve soft eraser for last stroke points

Now, the last point is managed separately in order to get smoother transition.
This commit is contained in:
Antonio Vazquez 2019-03-29 15:39:29 +01:00
parent a942d8859c
commit fb86d09195
1 changed files with 13 additions and 0 deletions

View File

@ -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++) {