Fix T57203: Rotation overlaps scale gizmo handles
authorCampbell Barton <ideasman42@gmail.com>
Wed, 15 May 2019 06:33:29 +0000 (16:33 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 15 May 2019 06:33:29 +0000 (16:33 +1000)
source/blender/editors/transform/transform_gizmo_3d.c

index 50610f1..35fda39 100644 (file)
@@ -1762,6 +1762,15 @@ static void WIDGETGROUP_gizmo_refresh(const bContext *C, wmGizmoGroup *gzgroup)
     }
   }
   MAN_ITER_AXES_END;
+
+  /* Ensure rotate disks don't overlap scale arrows, especially in ortho view. */
+  float rotate_select_bias = 0.0f;
+  if ((ggd->twtype & V3D_GIZMO_SHOW_OBJECT_SCALE) && ggd->twtype & V3D_GIZMO_SHOW_OBJECT_ROTATE) {
+    rotate_select_bias = -2.0f;
+  }
+  for (int i = MAN_AXIS_RANGE_ROT_START; i < MAN_AXIS_RANGE_ROT_END; i++) {
+    ggd->gizmos[i]->select_bias = rotate_select_bias;
+  }
 }
 
 static void WIDGETGROUP_gizmo_message_subscribe(const bContext *C,