[Bf-blender-cvs] [4039e944223] master: Fix T96790: Gpencil Inverted Fill makes extra stroke at origin
Antonio Vazquez
noreply at git.blender.org
Sat Mar 26 13:20:48 CET 2022
Commit: 4039e944223c2242d9551e22a4a313e3df9df628
Author: Antonio Vazquez
Date: Sat Mar 26 13:20:34 2022 +0100
Branches: master
https://developer.blender.org/rB4039e944223c2242d9551e22a4a313e3df9df628
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.
===================================================================
M source/blender/editors/gpencil/gpencil_fill.c
===================================================================
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index 8fc300412d9..94acf464691 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -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);
}
More information about the Bf-blender-cvs
mailing list