Fix T46148: Sculpt view-clip fails in ortho mode
authorCampbell Barton <ideasman42@gmail.com>
Fri, 18 Sep 2015 05:29:49 +0000 (15:29 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 18 Sep 2015 06:40:54 +0000 (16:40 +1000)
source/blender/editors/sculpt_paint/sculpt.c

index 4cedf522cbc5735ccda3eac315d3e9610015e162..07511e1924ece42d51530504fd64a98325c2d98f 100644 (file)
@@ -4217,7 +4217,10 @@ static float sculpt_raycast_init(ViewContext *vc, const float mouse[2], float ra
        sub_v3_v3v3(ray_normal, ray_end, ray_start);
        dist = normalize_v3(ray_normal);
 
-       if (!rv3d->is_persp) {
+       if ((rv3d->is_persp == false) &&
+           /* if the ray is clipped, don't adjust its start/end */
+           ((rv3d->rflag & RV3D_CLIPPING) == 0))
+       {
                BKE_pbvh_raycast_project_ray_root(ob->sculpt->pbvh, original, ray_start, ray_end, ray_normal);
 
                /* recalculate the normal */