-> Fix for bug #5472

Vertex snapping now works with backbuffered selection modes. Previously
backbuffer sampling had no way to check whether or not the indices that
it retrieved were selected or not. To resolve this I added two optional
arguments to sample_backbuf_rect in drawview.c. The first argument tells
the function that some additional testing  of the retrieved index values
needs to be done and the second argument is a pointer to a function to
do the testing. findnearestvert() in editmesh_mods.c now makes use of this
and passes sample_backbuf_rect() the appropriate argument when being used
for vertex snapping.
This commit is contained in:
2007-01-01 09:41:10 +00:00
parent c96e3e6e7d
commit d48a472fe5
4 changed files with 50 additions and 20 deletions

View File

@@ -134,7 +134,7 @@ int facesel_face_pick(Mesh *me, short *mval, unsigned int *index, short rect)
/* sample rect to increase changes of selecting, so that when clicking
on an edge in the backbuf, we can still select a face */
int dist;
*index = sample_backbuf_rect(mval, 3, 1, me->totface+1, &dist);
*index = sample_backbuf_rect(mval, 3, 1, me->totface+1, &dist,0,NULL);
}
else
/* sample only on the exact position */
@@ -163,7 +163,7 @@ static int facesel_edge_pick(Mesh *me, short *mval, unsigned int *index)
persp(PERSP_VIEW);
}
*index = sample_backbuf_rect(mval, 50, min, max, &dist);
*index = sample_backbuf_rect(mval, 50, min, max, &dist,0,NULL);
if (*index == 0)
return 0;