Fix T99381: GPencil Unable to Sculpt last point using Subdivide Modifier

The problem was the last point had the original point, but the previous one not, so the loop ends before checking last point.

The solution is avoid the loop exist if the function is checking the previous point before last one.
This commit is contained in:
Antonio Vazquez 2022-07-04 10:58:42 +02:00
parent 3f5073a8e2
commit 004913dd95
Notes: blender-bot 2023-02-14 06:00:49 +01:00
Referenced by issue #99381, GPencil: Unable to Sculpt last point when Subdivide Modifier is enabled
1 changed files with 2 additions and 1 deletions

View File

@ -1518,7 +1518,8 @@ static bool gpencil_sculpt_brush_do_stroke(tGP_BrushEditData *gso,
/* To each point individually... */
pt = &gps->points[i];
if ((pt->runtime.pt_orig == NULL) && (tool != GPSCULPT_TOOL_GRAB)) {
if ((i != gps->totpoints - 2) && (pt->runtime.pt_orig == NULL) &&
(tool != GPSCULPT_TOOL_GRAB)) {
continue;
}
pt_active = (pt->runtime.pt_orig) ? pt->runtime.pt_orig : pt;