diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-01-06 15:04:31 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-01-06 15:21:50 +0300 |
commit | 24d46bdbf745a4a319744f60a02f37a3d77654a5 (patch) | |
tree | 6c209e4371b4206cc8697f5fc94547b3721a449f /source/blender/editors/transform/transform_gizmo_2d.c | |
parent | 3978568e451e0a9e97824edc521de55ed9a6269c (diff) |
Gizmo: match UV editor gizmos more closely to the 3D view
Diffstat (limited to 'source/blender/editors/transform/transform_gizmo_2d.c')
-rw-r--r-- | source/blender/editors/transform/transform_gizmo_2d.c | 16 |
1 files changed, 10 insertions, 6 deletions
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. */ |