[Bf-blender-cvs] [884b167f74b] master: View 3D: scale object center selection penalty by the pixel size

Campbell Barton noreply at git.blender.org
Thu Mar 17 10:03:01 CET 2022


Commit: 884b167f74b2ec9e800cc64476bc036035139e02
Author: Campbell Barton
Date:   Thu Mar 17 19:59:57 2022 +1100
Branches: master
https://developer.blender.org/rB884b167f74b2ec9e800cc64476bc036035139e02

View 3D: scale object center selection penalty by the pixel size

All screen-space UI thresholds should scale by the interface scale.

===================================================================

M	source/blender/editors/space_view3d/view3d_select.c

===================================================================

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;
             }
           }



More information about the Bf-blender-cvs mailing list