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-09-24 12:18:28 +0300
committerAntonio Vazquez <blendergit@gmail.com>2022-09-24 12:18:39 +0300
commit8422da13c929f65850a723794a27baa924929377 (patch)
treedaa4f14d7317a6c98d502af55abbdb95e3aecf7e
parentf416a76bcd79f1c102f3c688335c76459c0c25bf (diff)
GPencil: Exist early from loop for Fill extensions
It does not need follow in the loop if a collision was found.
-rw-r--r--source/blender/editors/gpencil/gpencil_fill.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index c173a30a736..6bb1134e218 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -572,7 +572,7 @@ static void gpencil_cut_extensions(tGPDfill *tgpf)
copy_v3_v3(&extreme_a->x, intersection3D);
copy_v3_v3(&extreme_b->x, intersection3D);
set_stroke_collide(gps_a, gps_b, connection_dist);
- continue;
+ break;
}
/* Check if extensions cross. */
if (isect_seg_seg_v2_simple(a1xy, a2xy, b1xy, b2xy)) {
@@ -583,19 +583,20 @@ static void gpencil_cut_extensions(tGPDfill *tgpf)
copy_v3_v3(&extreme_a->x, intersection3D);
copy_v3_v3(&extreme_b->x, intersection3D);
set_stroke_collide(gps_a, gps_b, connection_dist);
- continue;
+ break;
}
/* Check if extension extreme is near of the origin of any other extension. */
if (len_squared_v2v2(a2xy, b1xy) <= gap_pixsize_sq) {
gpencil_point_xy_to_3d(&tgpf->gsc, tgpf->scene, b1xy, &extreme_a->x);
mul_m4_v3(inv_mat, &extreme_a->x);
set_stroke_collide(gps_a, gps_b, connection_dist);
- continue;
+ break;
}
if (len_squared_v2v2(a1xy, b2xy) <= gap_pixsize_sq) {
gpencil_point_xy_to_3d(&tgpf->gsc, tgpf->scene, a1xy, &extreme_b->x);
mul_m4_v3(inv_mat, &extreme_b->x);
set_stroke_collide(gps_a, gps_b, connection_dist);
+ break;
}
}
}