[Bf-blender-cvs] [8422da13c92] master: GPencil: Exist early from loop for Fill extensions

Antonio Vazquez noreply at git.blender.org
Sat Sep 24 11:18:42 CEST 2022


Commit: 8422da13c929f65850a723794a27baa924929377
Author: Antonio Vazquez
Date:   Sat Sep 24 11:18:28 2022 +0200
Branches: master
https://developer.blender.org/rB8422da13c929f65850a723794a27baa924929377

GPencil: Exist early from loop for Fill extensions

It does not need follow in the loop if a collision was found.

===================================================================

M	source/blender/editors/gpencil/gpencil_fill.c

===================================================================

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;
         }
       }
     }



More information about the Bf-blender-cvs mailing list