Fix snap mixed with vertices ignored for meshes with vertices only

The logic assumed that there were only 3 basic snapping modes.
This commit is contained in:
Germano Cavalcante 2021-04-18 20:04:58 -03:00
parent 06888a8970
commit 063c9938f1
1 changed files with 4 additions and 9 deletions

View File

@ -2231,16 +2231,11 @@ static short snapMesh(SnapObjectContext *sctx,
int *r_index)
{
BLI_assert(snapdata->snap_to_flag != SCE_SNAP_MODE_FACE);
if ((snapdata->snap_to_flag & ~SCE_SNAP_MODE_FACE) == SCE_SNAP_MODE_VERTEX) {
if (me->totvert == 0) {
return 0;
}
if (me->totvert == 0) {
return 0;
}
else {
if (me->totedge == 0) {
return 0;
}
else if (me->totedge == 0 && !(snapdata->snap_to_flag & SCE_SNAP_MODE_VERTEX)) {
return 0;
}
float lpmat[4][4];