[Bf-blender-cvs] [8c7727946c5] blender2.8: Gizmo: tweak navigation drawing for axis views

Campbell Barton noreply at git.blender.org
Thu Nov 15 04:55:54 CET 2018


Commit: 8c7727946c5bbf5119cd82c3ae08dcb65ab8076e
Author: Campbell Barton
Date:   Thu Nov 15 14:11:08 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB8c7727946c5bbf5119cd82c3ae08dcb65ab8076e

Gizmo: tweak navigation drawing for axis views

Axis aligned views now show both small/large handles,
this makes it possible to well if the view is in front or behind.

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

M	source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c

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

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 ae5ce27cd8d..356f671345a 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
@@ -292,8 +292,8 @@ static void axis_geom_draw(
 
 		bool ok = true;
 
-		/* skip view align axis */
-		if ((axis_align == axis) && (gz->matrix_offset[axis][2] > 0.0f) == is_pos) {
+		/* Skip view align axis when selecting (allows to switch to opposite side). */
+		if (select && ((axis_align == axis) && (gz->matrix_offset[axis][2] > 0.0f) == is_pos)) {
 			ok = false;
 		}
 		if (ok) {
@@ -313,7 +313,7 @@ static void axis_geom_draw(
 			 * This is a detail so primary axes show as dominant.
 			 */
 			const bool is_pos_color = (
-					((axis_order[axis_index].depth > (axis_depth_bias * (is_pos ? -1 : 1))) == (axis_align != axis)));
+			        axis_order[axis_index].depth > (axis_depth_bias * (is_pos ? -1 : 1)));
 
 
 			if (select == false) {
@@ -355,7 +355,7 @@ static void axis_geom_draw(
 			{
 				GPU_matrix_push();
 				GPU_matrix_translate_3fv(v_final);
-				GPU_matrix_scale_1f(show_axis_char ? AXIS_HANDLE_SIZE_FG : AXIS_HANDLE_SIZE_BG);
+				GPU_matrix_scale_1f(is_pos ? 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);



More information about the Bf-blender-cvs mailing list