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:
authorCampbell Barton <ideasman42@gmail.com>2017-09-19 21:29:04 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-09-19 21:29:04 +0300
commit16355d545b936f42008f1eeac7835f8b4130048d (patch)
tree68a961b6183baa562dca852a5eb1161d5b62057f
parentc4235356c95ef918aeb26ee2686c3e46686ac2b2 (diff)
Fix T52834: Polyfill2D fails with co-linear edges
-rw-r--r--source/blender/blenlib/intern/polyfill2d.c4
-rw-r--r--tests/gtests/blenlib/BLI_polyfill2d_test.cc3
2 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/polyfill2d.c b/source/blender/blenlib/intern/polyfill2d.c
index 5f9b92198a5..26f8709b16e 100644
--- a/source/blender/blenlib/intern/polyfill2d.c
+++ b/source/blender/blenlib/intern/polyfill2d.c
@@ -411,11 +411,11 @@ static bool kdtree2d_isect_tri_recursive(
}
#define KDTREE2D_ISECT_TRI_RECURSE_NEG \
- (((node->neg != KDNODE_UNSET) && (co[node->axis] > bounds[node->axis].min)) && \
+ (((node->neg != KDNODE_UNSET) && (co[node->axis] >= bounds[node->axis].min)) && \
(kdtree2d_isect_tri_recursive(tree, tri_index, tri_coords, tri_center, bounds, \
&tree->nodes[node->neg])))
#define KDTREE2D_ISECT_TRI_RECURSE_POS \
- (((node->pos != KDNODE_UNSET) && (co[node->axis] < bounds[node->axis].max)) && \
+ (((node->pos != KDNODE_UNSET) && (co[node->axis] <= bounds[node->axis].max)) && \
(kdtree2d_isect_tri_recursive(tree, tri_index, tri_coords, tri_center, bounds, \
&tree->nodes[node->pos])))
diff --git a/tests/gtests/blenlib/BLI_polyfill2d_test.cc b/tests/gtests/blenlib/BLI_polyfill2d_test.cc
index 5f10837fca1..ca3a67bd0a7 100644
--- a/tests/gtests/blenlib/BLI_polyfill2d_test.cc
+++ b/tests/gtests/blenlib/BLI_polyfill2d_test.cc
@@ -540,7 +540,6 @@ TEST(polyfill2d, IssueT41986_axis_align)
TEST_POLYFILL_TEMPLATE_STATIC(poly, false);
}
-#if 0
/* Blender bug T52834 */
TEST(polyfill2d, IssueT52834_axis_align_co_linear)
{
@@ -554,5 +553,3 @@ TEST(polyfill2d, IssueT52834_axis_align_co_linear)
TEST_POLYFILL_TEMPLATE_STATIC(poly, false);
}
-#endif
-