diff options
Diffstat (limited to 'source/blender/editors/mesh/editmesh_select.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_select.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index 80ef8894971..8eee6bcf6da 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -587,6 +587,8 @@ BMFace *EDBM_face_find_nearest(ViewContext *vc, float *r_dist) data.dist = FLT_MAX; data.toFace = efa; + ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); + mesh_foreachScreenFace(vc, findnearestface__getDistance, &data, V3D_PROJ_TEST_CLIP_DEFAULT); if ((vc->em->selectmode == SCE_SELECT_FACE) || (data.dist < *r_dist)) { /* only faces, no dist check */ @@ -613,14 +615,13 @@ BMFace *EDBM_face_find_nearest(ViewContext *vc, float *r_dist) data.dist = *r_dist; data.closest = NULL; data.closestIndex = 0; - ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); data.pass = 0; + ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); mesh_foreachScreenFace(vc, findnearestface__doClosest, &data, V3D_PROJ_TEST_CLIP_DEFAULT); if (data.dist > 3.0f) { data.pass = 1; - ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); mesh_foreachScreenFace(vc, findnearestface__doClosest, &data, V3D_PROJ_TEST_CLIP_DEFAULT); } |