diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-01-11 16:20:47 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-01-11 16:31:54 +0300 |
commit | 2a297366f0597ec8a01dc815834db19834498d81 (patch) | |
tree | 79716bc04d54989defdbf9d076f218291a8adc2d /source/blender/editors/uvedit | |
parent | fe53b6a7fbcd89a82a43921b10e9f13afd742fac (diff) |
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.
Diffstat (limited to 'source/blender/editors/uvedit')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_select.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; |