Fix T96790: Gpencil Inverted Fill makes extra stroke at origin

The problem was the stroke was created in the inverted loop before checking if the total of points is 0 and exit the loop.

Also some code Cleanup.
This commit is contained in:
Antonio Vazquez 2022-03-26 13:20:34 +01:00
parent 23bbc0d748
commit 4039e94422
Notes: blender-bot 2023-02-13 16:05:03 +01:00
Referenced by issue #88449: Blender LTS: Maintenance Task 2.93
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
Referenced by issue #96790, Gpencil: Inverted Fill makes extra stroke at origin (0,0,0)
Referenced by issue #96241, 3.1: Potential candidates for corrective releases
1 changed files with 8 additions and 8 deletions

View File

@ -2108,18 +2108,18 @@ static bool gpencil_do_frame_fill(tGPDfill *tgpf, const bool is_inverted)
int totpoints_prv = 0;
int loop_limit = 0;
while (totpoints > 0) {
/* analyze outline */
/* Analyze outline. */
gpencil_get_outline_points(tgpf, (totpoints == 1) ? true : false);
/* create array of points from stack */
/* Create array of points from stack. */
totpoints = gpencil_points_from_stack(tgpf);
if (totpoints > 0) {
/* Create z-depth array for reproject. */
gpencil_get_depth_array(tgpf);
/* create z-depth array for reproject */
gpencil_get_depth_array(tgpf);
/* create stroke and reproject */
gpencil_stroke_from_buffer(tgpf);
/* Create stroke and reproject. */
gpencil_stroke_from_buffer(tgpf);
}
if (is_inverted) {
gpencil_erase_processed_area(tgpf);
}