Fix T92311: Snap to faces in edit mode with x-ray enabled doesn't work

The `use_occlusion_test` parameter test was accidentally removed in
{rB91c33c8b9952}
This commit is contained in:
Germano Cavalcante 2021-10-18 11:41:16 -03:00
parent dd689eeda4
commit b246f81412
Notes: blender-bot 2023-02-13 17:23:13 +01:00
Referenced by issue #92311, Snap to faces in edit mode with x-ray enabled doesn't work anymore.
1 changed files with 6 additions and 3 deletions

View File

@ -1151,9 +1151,12 @@ static bool raycastObjects(SnapObjectContext *sctx,
float r_obmat[4][4],
ListBase *r_hit_list)
{
if (v3d && (params->edit_mode_type == SNAP_GEOM_EDIT) && XRAY_FLAG_ENABLED(v3d)) {
/* Use of occlude geometry in editing mode disabled. */
return false;
if (params->use_occlusion_test && v3d && XRAY_FLAG_ENABLED(v3d)) {
/* General testing of occlusion geometry is disabled if the snap is not intended for the edit
* cage. */
if (params->edit_mode_type == SNAP_GEOM_EDIT) {
return false;
}
}
sctx->runtime.depsgraph = depsgraph;