[Bf-blender-cvs] [24d46bdbf74] master: Gizmo: match UV editor gizmos more closely to the 3D view

Campbell Barton noreply at git.blender.org
Mon Jan 6 13:24:56 CET 2020


Commit: 24d46bdbf745a4a319744f60a02f37a3d77654a5
Author: Campbell Barton
Date:   Mon Jan 6 23:04:31 2020 +1100
Branches: master
https://developer.blender.org/rB24d46bdbf745a4a319744f60a02f37a3d77654a5

Gizmo: match UV editor gizmos more closely to the 3D view

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

M	source/blender/editors/transform/transform_gizmo_2d.c

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

diff --git a/source/blender/editors/transform/transform_gizmo_2d.c b/source/blender/editors/transform/transform_gizmo_2d.c
index 131345f7285..e76ece987df 100644
--- a/source/blender/editors/transform/transform_gizmo_2d.c
+++ b/source/blender/editors/transform/transform_gizmo_2d.c
@@ -204,7 +204,6 @@ void ED_widgetgroup_gizmo2d_xform_setup(const bContext *UNUSED(C), wmGizmoGroup
 
   for (int i = 0; i < ARRAY_SIZE(ggd->translate_xy); i++) {
     wmGizmo *gz = ggd->translate_xy[i];
-    const float offset[3] = {0.0f, 0.2f};
 
     /* custom handler! */
     WM_gizmo_set_fn_custom_modal(gz, gizmo2d_modal);
@@ -219,7 +218,11 @@ void ED_widgetgroup_gizmo2d_xform_setup(const bContext *UNUSED(C), wmGizmoGroup
       axis[(i + 1) % 2] = 1.0f;
       WM_gizmo_set_matrix_rotation_from_z_axis(gz, axis);
 
+      float offset[3] = {0, 0, 0};
+      offset[2] = 0.18f;
       WM_gizmo_set_matrix_offset_location(gz, offset);
+      gz->flag |= WM_GIZMO_DRAW_OFFSET_SCALE;
+
       WM_gizmo_set_line_width(gz, GIZMO_AXIS_LINE_WIDTH);
       WM_gizmo_set_color(gz, color);
       WM_gizmo_set_color_highlight(gz, color_hi);
@@ -234,8 +237,9 @@ void ED_widgetgroup_gizmo2d_xform_setup(const bContext *UNUSED(C), wmGizmoGroup
       /* Make the center low alpha. */
       WM_gizmo_set_line_width(gz, 2.0f);
       RNA_float_set(gz->ptr, "backdrop_fill_alpha", 0.0);
+      WM_gizmo_set_color(gz, (const float[4]){1, 1, 1, 0.6});
 
-      WM_gizmo_set_scale(gz, 1.2f);
+      WM_gizmo_set_scale(gz, 0.2f);
     }
 
     /* Assign operator. */
@@ -519,19 +523,17 @@ void ED_widgetgroup_gizmo2d_resize_setup(const bContext *UNUSED(C), wmGizmoGroup
     WM_gizmo_set_fn_custom_modal(gz, gizmo2d_modal);
 
     if (i < 2) {
-      const float offset[3] = {0.0f, 0.2f};
       float color[4], color_hi[4];
       gizmo2d_get_axis_color(i, color, color_hi);
 
       /* set up widget data */
-      RNA_float_set(gz->ptr, "length", 0.8f);
+      RNA_float_set(gz->ptr, "length", 1.0f);
       float axis[3] = {0.0f};
       axis[(i + 1) % 2] = 1.0f;
       WM_gizmo_set_matrix_rotation_from_z_axis(gz, axis);
 
       RNA_enum_set(gz->ptr, "draw_style", ED_GIZMO_ARROW_STYLE_BOX);
 
-      WM_gizmo_set_matrix_offset_location(gz, offset);
       WM_gizmo_set_line_width(gz, GIZMO_AXIS_LINE_WIDTH);
       WM_gizmo_set_color(gz, color);
       WM_gizmo_set_color_highlight(gz, color_hi);
@@ -546,6 +548,7 @@ void ED_widgetgroup_gizmo2d_resize_setup(const bContext *UNUSED(C), wmGizmoGroup
       /* Make the center low alpha. */
       WM_gizmo_set_line_width(gz, 2.0f);
       RNA_float_set(gz->ptr, "backdrop_fill_alpha", 0.0);
+      WM_gizmo_set_color(gz, (const float[4]){1, 1, 1, 0.6});
 
       WM_gizmo_set_scale(gz, 1.2f);
     }
@@ -641,7 +644,7 @@ void ED_widgetgroup_gizmo2d_rotate_setup(const bContext *UNUSED(C), wmGizmoGroup
 
     /* custom handler! */
     WM_gizmo_set_fn_custom_modal(gz, gizmo2d_modal);
-    WM_gizmo_set_scale(gz, 1.0f);
+    WM_gizmo_set_scale(gz, 1.2f);
 
     {
       PropertyRNA *prop = RNA_struct_find_property(gz->ptr, "icon");
@@ -651,6 +654,7 @@ void ED_widgetgroup_gizmo2d_rotate_setup(const bContext *UNUSED(C), wmGizmoGroup
       /* Make the center low alpha. */
       WM_gizmo_set_line_width(gz, 2.0f);
       RNA_float_set(gz->ptr, "backdrop_fill_alpha", 0.0);
+      WM_gizmo_set_color(gz, (const float[4]){1, 1, 1, 0.6});
     }
 
     /* Assign operator. */



More information about the Bf-blender-cvs mailing list