[Bf-blender-cvs] [dd4c0858f63] blender-v2.82-release: Fix T74278: Light, Image Object, and Compositor Backdrop Viewer Node gizmos are too big

Philipp Oeser noreply at git.blender.org
Mon Mar 9 20:56:36 CET 2020


Commit: dd4c0858f63334e869f4ed9b288854d386711b1e
Author: Philipp Oeser
Date:   Mon Mar 2 14:43:20 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBdd4c0858f63334e869f4ed9b288854d386711b1e

Fix T74278: Light, Image Object, and Compositor Backdrop Viewer Node
gizmos are too big

Caused by rB9cac5fa681c5 which fixed the handles for the camera border
gizmo (being much too small)-- which in turn was broken by
rB98e4fbc7cc9e.

Camera border gizmo sets up its matrix_space a bit differently [this is
why we are getting very small values in gizmo_calc_rect_view_scale --
needs more investigation], but instead of breaking it for Light, Image
and Compositor Backdrop, lets just compensate by scaling the Camera
Border Gizmo for now.

Maniphest Tasks: T74278

Differential Revision: https://developer.blender.org/D6991

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

M	source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
M	source/blender/editors/space_view3d/view3d_gizmo_camera.c

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

diff --git a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
index ff05cdb2613..2e4284d357a 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
@@ -91,7 +91,7 @@ static bool gizmo_calc_rect_view_scale(const wmGizmo *gz, const float dims[2], f
 static bool gizmo_calc_rect_view_margin(const wmGizmo *gz, const float dims[2], float margin[2])
 {
   float handle_size;
-  handle_size = 10.0f;
+  handle_size = 0.15f;
   handle_size *= gz->scale_final;
   float scale_xy[2];
   if (!gizmo_calc_rect_view_scale(gz, dims, scale_xy)) {
diff --git a/source/blender/editors/space_view3d/view3d_gizmo_camera.c b/source/blender/editors/space_view3d/view3d_gizmo_camera.c
index ba5ca5fbd15..8e279b2d11a 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_camera.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_camera.c
@@ -432,6 +432,8 @@ static void WIDGETGROUP_camera_view_setup(const bContext *UNUSED(C), wmGizmoGrou
   /* Box style is more subtle in this case. */
   RNA_enum_set(viewgroup->border->ptr, "draw_style", ED_GIZMO_CAGE2D_STYLE_BOX);
 
+  WM_gizmo_set_scale(viewgroup->border, 10.0f / 0.15f);
+
   gzgroup->customdata = viewgroup;
 }



More information about the Bf-blender-cvs mailing list