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-01-04 19:07:21 +0300
committerAntonio Vazquez <blendergit@gmail.com>2022-01-04 19:08:05 +0300
commit55842b424477e8eed1756a28bdd82666e484c5a3 (patch)
treed9c9dcec1a3868d28139e9362725d183d44f49ca
parentad8e2d6661034876ee451f77f362ff5599f476b2 (diff)
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`.
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c2
1 files changed, 1 insertions, 1 deletions
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);