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:
authorAntonio Vazquez <blendergit@gmail.com>2022-03-26 15:20:34 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2022-04-19 16:57:38 +0300
commit7dd15b7113493f002401ee3447a0b52d09889eaf (patch)
tree9980de4830c7ac77d594a1832bae2bf6d1e33b0d
parent69cea4fce15fa4542b62a21d26987e14bd733744 (diff)
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.
-rw-r--r--source/blender/editors/gpencil/gpencil_fill.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index bb0a2916d2d..27e929df69b 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -2009,18 +2009,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);
}