diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-10-18 03:41:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-10-18 03:50:22 +0300 |
commit | eee8153299174cdb445e341339a2153ffab87333 (patch) | |
tree | 063a07c5ca72c3dbf4da7f9fec1f4ce15b1117ce /source/blender/editors/transform | |
parent | 40f679ccb9370a3827a2ac44b8bab40290768548 (diff) |
Gizmo: depth sort shear gizmos
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform_gizmo_3d.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c index b9c984f7f21..bf9f09abf3a 100644 --- a/source/blender/editors/transform/transform_gizmo_3d.c +++ b/source/blender/editors/transform/transform_gizmo_3d.c @@ -2035,8 +2035,9 @@ static void WIDGETGROUP_xform_shear_setup(const bContext *UNUSED(C), wmGizmoGrou for (int j = 0; j < 2; j++) { wmGizmo *gz = WM_gizmo_new_ptr(gzt_arrow, gzgroup, NULL); RNA_enum_set(gz->ptr, "draw_style", ED_GIZMO_ARROW_STYLE_BOX); - const int i_ortho = (i + j + 1) % 3; - interp_v3_v3v3(gz->color, axis_color[i], axis_color[i_ortho], 0.33f); + const int i_ortho_a = (i + j + 1) % 3; + const int i_ortho_b = (i + (1 - j) + 1) % 3; + interp_v3_v3v3(gz->color, axis_color[i_ortho_a], axis_color[i_ortho_b], 0.75f); gz->color[3] = 0.5f; PointerRNA *ptr = WM_gizmo_operator_set(gz, 0, ot_shear, NULL); RNA_boolean_set(ptr, "release_confirm", 1); @@ -2132,6 +2133,14 @@ static void WIDGETGROUP_xform_shear_draw_prepare(const bContext *C, wmGizmoGroup } } } + + /* Basic ordering for drawing only. */ + { + LISTBASE_FOREACH (wmGizmo *, gz, &gzgroup->gizmos) { + gz->temp.f = dot_v3v3(rv3d->viewinv[2], gz->matrix_basis[2]); + } + BLI_listbase_sort(&gzgroup->gizmos, WM_gizmo_cmp_temp_fl_reverse); + } } void VIEW3D_GGT_xform_shear(wmGizmoGroupType *gzgt) |