Fix T72112: Perpendicular snapping with closest not working

The closest target is calculated only after a snap point is found.
So use `center_global` while the target is not calculated.
This commit is contained in:
2019-12-03 12:20:27 -03:00
parent b81939716d
commit 574a59dfb0

View File

@@ -1362,6 +1362,7 @@ static void TargetSnapClosest(TransInfo *t)
short snapObjectsTransform(
TransInfo *t, const float mval[2], float *dist_px, float r_loc[3], float r_no[3])
{
float *target = (t->tsnap.status & TARGET_INIT) ? t->tsnap.snapTarget : t->center_global;
return ED_transform_snap_object_project_view3d_ex(
t->tsnap.object_context,
t->scene->toolsettings->snap_mode,
@@ -1373,7 +1374,7 @@ short snapObjectsTransform(
SCE_SNAP_BACKFACE_CULLING) != 0,
},
mval,
t->tsnap.snapTarget,
target,
dist_px,
r_loc,
r_no,