Fix #106478: Missing xray check in snapping

Regression caused by 98bfa8d4589cae47d0b7ae9ff576a9acca91ab88

The `XRAY_ENABLED(v3d)` check was lost during a modification to
`transform_snap_context_project_view3d_mixed_impl` function.

This caused vertex snapping in solid shading to jump between visible
and occluded faces.

Pull Request: https://projects.blender.org/blender/blender/pulls/106495
This commit is contained in:
YimingWu 2023-04-04 15:40:48 +02:00 committed by Germano Cavalcante
parent ff3b2226fb
commit f94599c095

@ -3275,7 +3275,9 @@ static eSnapMode transform_snap_context_project_view3d_mixed_impl(SnapObjectCont
}
}
if (snap_to_flag & SCE_SNAP_MODE_FACE_RAYCAST) {
bool use_occlusion_test = params->use_occlusion_test && !XRAY_ENABLED(v3d);
if ((snap_to_flag & SCE_SNAP_MODE_FACE_RAYCAST) || use_occlusion_test) {
float ray_start[3], ray_normal[3];
if (!ED_view3d_win_to_ray_clipped_ex(
depsgraph, region, v3d, mval, nullptr, ray_normal, ray_start, true)) {