[Bf-blender-cvs] [2a297366f05] master: Fix T84565: UV face select fails when zoomed in
Campbell Barton
noreply at git.blender.org
Mon Jan 11 14:55:13 CET 2021
Commit: 2a297366f0597ec8a01dc815834db19834498d81
Author: Campbell Barton
Date: Tue Jan 12 00:20:47 2021 +1100
Branches: master
https://developer.blender.org/rB2a297366f0597ec8a01dc815834db19834498d81
Fix T84565: UV face select fails when zoomed in
Exposed by recent commit 246efd7286f6187e4dd4b3edcc79cccb1746bb1d
Although this was an existing logical error causing
`uv_find_nearest_face` to only work properly when the hit distance was
initialized to FLT_MAX, which wasn't the case in multi-object edit mode.
===================================================================
M source/blender/editors/uvedit/uvedit_select.c
===================================================================
diff --git a/source/blender/editors/uvedit/uvedit_select.c b/source/blender/editors/uvedit/uvedit_select.c
index 118a2263cc3..34e953597fb 100644
--- a/source/blender/editors/uvedit/uvedit_select.c
+++ b/source/blender/editors/uvedit/uvedit_select.c
@@ -732,9 +732,11 @@ bool uv_find_nearest_face(Scene *scene, Object *obedit, const float co[2], UvNea
const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
- /* this will fill in hit.vert1 and hit.vert2 */
+ /* This will fill in `hit.l`. */
float dist_sq_init = hit_final->dist_sq;
UvNearestHit hit = *hit_final;
+ /* The edge of the face might be further away than the threshold from it's center. */
+ hit.dist_sq = FLT_MAX;
if (uv_find_nearest_edge(scene, obedit, co, &hit)) {
hit.dist_sq = dist_sq_init;
hit.l = NULL;
More information about the Bf-blender-cvs
mailing list