1
1

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
This commit is contained in:
2022-05-19 18:05:15 +02:00
parent 65e13cc2d2
commit 9e9895b055

View File

@@ -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))) {