Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-04-21 14:16:19 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-04-21 14:25:43 +0300
commite3a6440e7af7f90432319aec9f6ad43b557def31 (patch)
tree6fa80f9fc9547d6c20b9cd92e0b673865f588257 /source/blender/editors/space_view3d
parent907d4d310f697a2a9b5c83bb2fc428175a7daaf2 (diff)
BMesh: mesh-data picking, general improvements
Generalize logic for vert/edge/face selection: - index cycling. - selection bias with mixed modes. Details: - Edges now support index cycling (as verts/faces did already) - Cycling over near elements is now only enabled when the mouse position remains the same. - No longer do 2 selection passes to perform index cycling. Fixes: - Edges behind the view could be selected (surprising nobody reported!) - Selection bias now only changes the element that gets picked without interning the return distance (was buggy with mixed modes).
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 9fcdb77ef7f..a69a6be298e 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1587,13 +1587,11 @@ unsigned int ED_view3d_backbuf_sample_rect(
if (*tbuf && *tbuf >= min && *tbuf < max) {
/* we got a hit */
- /* get x,y pixel coords from the offset */
- const float delta[2] = {
- ((tbuf - buf->rect) % size) - (size / 2),
- ((tbuf - buf->rect) / size) - (size / 2),
- };
-
- *r_dist = len_v2(delta);
+ /* get x,y pixel coords from the offset
+ * (manhatten distance in keeping with other screen-based selection) */
+ *r_dist = (float)(
+ abs(((tbuf - buf->rect) % size) - (size / 2)) +
+ abs(((tbuf - buf->rect) / size) - (size / 2)));
/* indices start at 1 here */
index = (*tbuf - min) + 1;