From 10f1972ff78bffb5323cebb85125c64efc7b5ca8 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Thu, 29 Sep 2022 13:51:58 +0200 Subject: GPencil: Fix missing Fill stroke cross detection If the cross point was in the extreme of the stroke the collision was not detected because it could be outside of the bbox. Removed the bbox check because now it is not necessary. --- source/blender/editors/gpencil/gpencil_fill.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c index aec0af6cd9f..d1e51bf64d2 100644 --- a/source/blender/editors/gpencil/gpencil_fill.c +++ b/source/blender/editors/gpencil/gpencil_fill.c @@ -479,21 +479,6 @@ static void gpencil_load_array_strokes(tGPDfill *tgpf) tgpf->stroke_array_num = idx; } -/* Check if a 2D point is inside a 2D Bounding Box. */ -static bool is_point_in_bbox(tGPDfill *tgpf, - bGPDstroke *gps, - float diff_mat[4][4], - float point2d[2]) -{ - float boundbox_min[2]; - float boundbox_max[2]; - - ED_gpencil_projected_2d_bound_box(&tgpf->gsc, gps, diff_mat, boundbox_min, boundbox_max); - - rctf rect_stroke = {boundbox_min[0], boundbox_max[0], boundbox_min[1], boundbox_max[1]}; - return BLI_rctf_isect_pt_v(&rect_stroke, point2d); -} - static void set_stroke_collide(bGPDstroke *gps_a, bGPDstroke *gps_b, const float connection_dist) { gps_a->flag |= GP_STROKE_COLLIDE; @@ -544,11 +529,6 @@ static void gpencil_stroke_collision( float intersection2D[2]; isect_line_line_v2_point( a1xy, a2xy, stroke->points2d[i], stroke->points2d[i + 1], intersection2D); - /* Verify the collision is inside the bounding box of the strokes. */ - if (!is_point_in_bbox(tgpf, gps_a, diff_mat, intersection2D) && - !is_point_in_bbox(tgpf, gps_b, diff_mat, intersection2D)) { - continue; - } gpencil_point_xy_to_3d(&tgpf->gsc, tgpf->scene, intersection2D, &extreme_a->x); mul_m4_v3(inv_mat, &extreme_a->x); -- cgit v1.2.3