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-29 14:51:58 +0300
committerAntonio Vazquez <blendergit@gmail.com>2022-09-29 14:51:58 +0300
commit10f1972ff78bffb5323cebb85125c64efc7b5ca8 (patch)
tree1eb607c1a337bd90e62cdac8b09f0e7e3b40c0c4
parentf6c2f1c65e146bf20b9182f275b67c747d9e2990 (diff)
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.
-rw-r--r--source/blender/editors/gpencil/gpencil_fill.c20
1 files changed, 0 insertions, 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);