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:
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_select.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 11623d06fff..fd7179d06dd 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -417,11 +417,12 @@ static void do_lasso_select_objects(ViewContext *vc, const int mcords[][2], cons
for (base = vc->scene->base.first; base; base = base->next) {
if (BASE_SELECTABLE(vc->v3d, base)) { /* use this to avoid un-needed lasso lookups */
- ED_view3d_project_base(vc->ar, base);
- if (BLI_lasso_is_point_inside(mcords, moves, base->sx, base->sy, IS_CLIPPED)) {
-
- ED_base_object_select(base, select ? BA_SELECT : BA_DESELECT);
- base->object->flag = base->flag;
+ if (ED_view3d_project_base(vc->ar, base) == V3D_PROJ_RET_OK) {
+ if (BLI_lasso_is_point_inside(mcords, moves, base->sx, base->sy, IS_CLIPPED)) {
+
+ ED_base_object_select(base, select ? BA_SELECT : BA_DESELECT);
+ base->object->flag = base->flag;
+ }
}
if (vc->obact == base->object && (base->object->mode & OB_MODE_POSE)) {
do_lasso_select_pose(vc, base->object, mcords, moves, select);
@@ -1093,20 +1094,22 @@ static Base *object_mouse_select_menu(bContext *C, ViewContext *vc, unsigned int
/* two selection methods, the CTRL select uses max dist of 15 */
if (buffer) {
- int a;
- for (a = 0; a < hits; a++) {
+ for (int a = 0; a < hits; a++) {
/* index was converted */
- if (base->selcol == buffer[(4 * a) + 3])
+ if (base->selcol == (buffer[(4 * a) + 3] & ~0xFFFF0000)) {
ok = true;
+ break;
+ }
}
}
else {
- int temp, dist = 15;
- ED_view3d_project_base(vc->ar, base);
-
- temp = abs(base->sx - mval[0]) + abs(base->sy - mval[1]);
- if (temp < dist)
- ok = true;
+ const int dist = 15 * U.pixelsize;
+ if (ED_view3d_project_base(vc->ar, base) == V3D_PROJ_RET_OK) {
+ const int delta_px[2] = {base->sx - mval[0], base->sy - mval[1]};
+ if (len_manhattan_v2_int(delta_px) < dist) {
+ ok = true;
+ }
+ }
}
if (ok) {
@@ -1465,7 +1468,7 @@ static bool ed_object_select_pick(
const bool has_bones = selectbuffer_has_bones(buffer, hits);
/* note; shift+alt goes to group-flush-selecting */
- if (has_bones == 0 && enumerate) {
+ if (enumerate) {
basact = object_mouse_select_menu(C, &vc, buffer, hits, mval, toggle);
}
else {