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-07-18 15:03:52 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-07-18 15:08:10 +0300
commit257d072317f21861cdb7c168a60497bcb74d73d4 (patch)
tree933baf4e735b0731757e428f056a00e4cfe559d9 /source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
parent8cd7828792419fb4eac9a2a477968535b4c71535 (diff)
3D View: show 3D axis-letter when pointing away
While only the positive axis is shown, account for an exception when axis aligned.
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, 5 insertions, 2 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 238a956cf26..93617f22490 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
@@ -241,6 +241,9 @@ static void axis_geom_draw(const wmGizmo *gz, const float color[4], const bool U
ok = false;
}
if (ok) {
+ /* Check aligned, since the front axis won't display in this case,
+ * and we want to make sure all 3 axes have a character at all times. */
+ const bool show_axis_char = (is_pos || (axis == axis_align));
const float v[3] = {0, 0, 3 * (is_pos ? 1 : -1)};
const float v_final[3] = {
v[index_x] * scale_axis,
@@ -278,7 +281,7 @@ static void axis_geom_draw(const wmGizmo *gz, const float color[4], const bool U
{
GPU_matrix_push();
GPU_matrix_translate_3fv(v_final);
- GPU_matrix_scale_1f(is_pos ? 0.22f : 0.18f);
+ GPU_matrix_scale_1f(show_axis_char ? 0.22f : 0.18f);
GPUBatch *sphere = GPU_batch_preset_sphere(0);
GPU_batch_program_set_builtin(sphere, GPU_SHADER_3D_UNIFORM_COLOR);
@@ -288,7 +291,7 @@ static void axis_geom_draw(const wmGizmo *gz, const float color[4], const bool U
}
/* Axis XYZ Character. */
- if (is_pos) {
+ if (show_axis_char) {
GPU_line_width(1.0f);
float m3[3][3];
copy_m3_m4(m3, gz->matrix_offset);