From 7a475a89eb398ca5f42ddfdef3c04aa8051858f2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 29 Apr 2021 17:16:23 +1000 Subject: Fix T87823: Select similar doesn't work with small faces FLT_EPSILON was added to the threshold when comparing values, this caused problems selecting similar small faces since the areas can be very small in this case. Also increase the displayed precision so it's easier to use smaller numbers. --- source/blender/editors/util/select_utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/util') diff --git a/source/blender/editors/util/select_utils.c b/source/blender/editors/util/select_utils.c index 14a6d751bb1..4e8cf1e92e6 100644 --- a/source/blender/editors/util/select_utils.c +++ b/source/blender/editors/util/select_utils.c @@ -88,11 +88,11 @@ int ED_select_similar_compare_float(const float delta, const float thresh, const { switch (compare) { case SIM_CMP_EQ: - return (fabsf(delta) < thresh + FLT_EPSILON); + return (fabsf(delta) <= thresh); case SIM_CMP_GT: - return ((delta + thresh) > -FLT_EPSILON); + return ((delta + thresh) >= 0.0); case SIM_CMP_LT: - return ((delta - thresh) < FLT_EPSILON); + return ((delta - thresh) <= 0.0); default: BLI_assert_unreachable(); return 0; -- cgit v1.2.3