Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-11-15 00:17:16 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-11-15 00:17:16 +0300
commit28e7c94de26a4706af16d6f2893917ca910a27ce (patch)
tree675758dfc1357e5507ce5915b761f63b18eeb65e /source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
parentd04947b42209a6af08e399c004a31d235e0c7eb9 (diff)
Gizmo: minor fix for navigation axis color
When view aligned, the near axis was hidden, making it seem as if the opposite axis was at the front.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c7
1 files changed, 6 insertions, 1 deletions
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 c32a8f46182..422f6e07c68 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
@@ -341,13 +341,18 @@ static void axis_geom_draw(
/* Axis Ball. */
{
+ /* Flip the faded state when axis aligned, since we're hiding the front-mode axis
+ * otherwise we see the color for the back-most axis, which is useful for
+ * click-to-rotate 180d but not useful to visualize. */
+ const bool is_pos_color = is_pos == (axis_align != axis);
+
GPU_matrix_push();
GPU_matrix_translate_3fv(v_final);
GPU_matrix_scale_1f(show_axis_char ? AXIS_HANDLE_SIZE_FG : AXIS_HANDLE_SIZE_BG);
GPUBatch *sphere = GPU_batch_preset_sphere(0);
GPU_batch_program_set_builtin(sphere, GPU_SHADER_3D_UNIFORM_COLOR);
- GPU_batch_uniform_4fv(sphere, "color", is_pos ? color_current : color_current_fade);
+ GPU_batch_uniform_4fv(sphere, "color", is_pos_color ? color_current : color_current_fade);
GPU_batch_draw(sphere);
GPU_matrix_pop();
}