transform_snap_object: Do not use occlusion test when X-Ray is enabled.
authorGermano <germano.costa@ig.com.br>
Sat, 2 Jun 2018 16:11:51 +0000 (13:11 -0300)
committerGermano <germano.costa@ig.com.br>
Sat, 2 Jun 2018 16:11:51 +0000 (13:11 -0300)
source/blender/editors/transform/transform_snap_object.c

index d3092fa..5932a35 100644 (file)
@@ -2467,7 +2467,11 @@ static short transform_snap_context_project_view3d_mixed_impl(
        const ARegion *ar = sctx->v3d_data.ar;
        const RegionView3D *rv3d = ar->regiondata;
 
-       if (snap_to_flag & SCE_SNAP_MODE_FACE || params->use_occlusion_test) {
+       bool use_occlusion_test =
+               params->use_occlusion_test &&
+               !(sctx->v3d_data.v3d->shading.flag & V3D_SHADING_XRAY);
+
+       if (snap_to_flag & SCE_SNAP_MODE_FACE || use_occlusion_test) {
                float ray_start[3], ray_normal[3];
 
                if (!ED_view3d_win_to_ray_ex(