[Bf-blender-cvs] [55842b42447] master: Fix T94620: GPencil AutoMerge does not work when Draw On Back is enabled

Antonio Vazquez noreply at git.blender.org
Tue Jan 4 17:08:10 CET 2022


Commit: 55842b424477e8eed1756a28bdd82666e484c5a3
Author: Antonio Vazquez
Date:   Tue Jan 4 17:07:21 2022 +0100
Branches: master
https://developer.blender.org/rB55842b424477e8eed1756a28bdd82666e484c5a3

Fix T94620: GPencil AutoMerge does not work when Draw On Back is enabled

The problem was the stroke was added to head and the `prev` pointer was NULL. Now check if there is the list is empty`next`.

===================================================================

M	source/blender/editors/gpencil/gpencil_paint.c

===================================================================

diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 498c6baa4b1..b52d4a410ec 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1282,7 +1282,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
 
   /* Join with existing strokes. */
   if (ts->gpencil_flags & GP_TOOL_FLAG_AUTOMERGE_STROKE) {
-    if (gps->prev != NULL) {
+    if ((gps->prev != NULL) || (gps->next != NULL)) {
       BKE_gpencil_stroke_boundingbox_calc(gps);
       float diff_mat[4][4], ctrl1[2], ctrl2[2];
       BKE_gpencil_layer_transform_matrix_get(depsgraph, p->ob, gpl, diff_mat);



More information about the Bf-blender-cvs mailing list