[Bf-blender-cvs] [6fc016d9632] master: Gizmo: fix button 2D hotspot size

Campbell Barton noreply at git.blender.org
Fri Dec 13 08:12:06 CET 2019


Commit: 6fc016d963248c5c0b07f118da356b469c42cc44
Author: Campbell Barton
Date:   Fri Dec 13 15:52:39 2019 +1100
Branches: master
https://developer.blender.org/rB6fc016d963248c5c0b07f118da356b469c42cc44

Gizmo: fix button 2D hotspot size

Happened when used in 2D view.

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

M	source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
M	source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c

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

diff --git a/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
index 7e6db43dbb3..ef3014eabc2 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
@@ -286,7 +286,7 @@ static int gizmo_button2d_test_select(bContext *C, wmGizmo *gz, const int mval[2
   else {
     copy_v2_v2(point_local, (float[2]){UNPACK2(mval)});
     sub_v2_v2(point_local, gz->matrix_basis[3]);
-    mul_v2_fl(point_local, 1.0f / (gz->scale_basis * UI_DPI_FAC));
+    mul_v2_fl(point_local, 1.0f / gz->scale_final);
   }
   /* The 'gz->scale_final' is already applied when projecting. */
   if (len_squared_v2(point_local) < 1.0f) {
diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
index d6d3a3dc563..504b10888e8 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
@@ -466,7 +466,7 @@ static int gizmo_axis_test_select(bContext *UNUSED(C), wmGizmo *gz, const int mv
 {
   float point_local[2] = {UNPACK2(mval)};
   sub_v2_v2(point_local, gz->matrix_basis[3]);
-  mul_v2_fl(point_local, 1.0f / (gz->scale_basis * UI_DPI_FAC));
+  mul_v2_fl(point_local, 1.0f / gz->scale_final);
 
   const float len_sq = len_squared_v2(point_local);
   if (len_sq > 1.0) {



More information about the Bf-blender-cvs mailing list