diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2022-01-04 19:07:21 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2022-01-11 12:18:21 +0300 |
commit | 29c4c78a38964408f685b7f6e18ff5a1451ef1d6 (patch) | |
tree | eba2bdb40934a6301d128cd12b6dc2918615c997 | |
parent | cd804fb2e968e170629583a13eec62732ccd039c (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.c | 2 |
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 3e9f22f25d3..333ae60e84b 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1276,7 +1276,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); |