diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-17 11:59:57 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-17 12:02:37 +0300 |
commit | 884b167f74b2ec9e800cc64476bc036035139e02 (patch) | |
tree | ebe1bc7133156452d6b0f13d344b2a2996d8e64b /source/blender/editors | |
parent | e0a8f9b78e7a3e5d8dcd3b490989401d461936ed (diff) |
View 3D: scale object center selection penalty by the pixel size
All screen-space UI thresholds should scale by the interface scale.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_select.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 98cf222af17..2d3d27fc855 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -2410,6 +2410,8 @@ static bool ed_object_select_pick(bContext *C, basact = object_mouse_select_menu(C, &vc, NULL, 0, mval, params); } else { + /* Put the active object at a disadvantage to cycle through other objects. */ + const float penalty_dist = 10.0f * U.dpi_fac; base = startbase; while (base) { if (BASE_SELECTABLE(v3d, base)) { @@ -2417,12 +2419,12 @@ static bool ed_object_select_pick(bContext *C, if (ED_view3d_project_float_global( region, base->object->obmat[3], screen_co, V3D_PROJ_TEST_CLIP_DEFAULT) == V3D_PROJ_RET_OK) { - float dist_temp = len_manhattan_v2v2(mval_fl, screen_co); + float dist_test = len_manhattan_v2v2(mval_fl, screen_co); if (base == oldbasact) { - dist_temp += 10.0f; + dist_test += penalty_dist; } - if (dist_temp < dist) { - dist = dist_temp; + if (dist_test < dist) { + dist = dist_test; basact = base; } } |