diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2022-05-19 19:05:15 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2022-05-19 19:05:15 +0300 |
commit | 9e9895b055d490b0793bc7c5662f50abafce9a24 (patch) | |
tree | 1fa0f81632428653f1886190297b0c5acb51b6c2 /source/blender/editors/gpencil | |
parent | 65e13cc2d232f85da6c2e437c5fc5cc5debd914e (diff) |
GPencil: Avoid Automerge with Closed strokes
The algorithm is not designed to be used with Closed strokes (cyclic) and actually the result is arbitrary. In order to avoid this, now the closed strokes never are merged.
Related to T98235
Feedback by: @mendio
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 2dc12125f40..23c385c1213 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -3077,6 +3077,11 @@ bGPDstroke *ED_gpencil_stroke_nearest_to_ends(bContext *C, continue; } + /* Check that stroke is not closed. Closed strokes must not be included in the merge. */ + if (gps_target->flag & GP_STROKE_CYCLIC) { + continue; + } + /* Check if one of the ends is inside target stroke bounding box. */ if ((!ED_gpencil_stroke_check_collision(gsc, gps_target, pt2d_start, radius, diff_mat)) && (!ED_gpencil_stroke_check_collision(gsc, gps_target, pt2d_end, radius, diff_mat))) { |