Thumbstick camera rotation is slower when rotating in a diagonal direction

Hi, sorry if this is a simple fix. I’m trying to set up my camera rotation script with a controller, the problem is, the camera rotates slower the more diagonal the input is. This makes it difficult to track moving targets when the input isn’t consistent. Is there a way to remap the input so that the input is always consistent even at diagonal angles? I’ve tried to illustrate the issue and what I want below.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;

public class CameraLookController : MonoBehaviour
{
    public PlayerInput playerInput;

    [SerializeField] private Transform playerBody;
    [SerializeField] private Transform playerCamera;
    [SerializeField] private float lookSensitivity;
    [SerializeField] private AnimationCurve inputCurve;
    [SerializeField] private float clampAngle = 90f;

    private Vector2 inputDirection;
    private float clampedRotationX;

    private void Awake()
    {
        playerInput = new PlayerInput();
        playerInput.Player.Look.performed += context => GetLookInput(context.ReadValue<Vector2>());
        playerInput.Player.Look.canceled += context => GetLookInput(context.ReadValue<Vector2>());

        inputCurve.preWrapMode = WrapMode.PingPong;
    }

    private void OnEnable()
    {
        playerInput.Enable();

        Cursor.visible = false;
    }

    private void OnDisable()
    {
        playerInput.Disable();
    }

    private void GetLookInput(Vector2 axis)
    {
        inputDirection.x = axis.x;
        inputDirection.y = axis.y;

        print("Input Direction " + inputDirection);
    }

    private void Update()
    {
        //Camera Look
        int xDirection;
        int yDirection;

        xDirection = inputDirection.x > 0 ?  1 : -1;
        yDirection = inputDirection.y > 0 ?  1 : -1;

        float curveEvaluatedX = inputCurve.Evaluate(inputDirection.x) * xDirection;
        float curveEvaluatedY = inputCurve.Evaluate(inputDirection.y) * yDirection;

        float modifiedInputX = curveEvaluatedX * lookSensitivity * Time.deltaTime;
        float modifiedInputY = curveEvaluatedY * lookSensitivity * Time.deltaTime;

        clampedRotationX -= modifiedInputY;
        clampedRotationX = Mathf.Clamp(clampedRotationX, -clampAngle, clampAngle);

        playerCamera.localRotation = Quaternion.Euler(clampedRotationX, 0f, 0f);
        playerBody.Rotate(Vector3.up * modifiedInputX);
    }

}

To do this you would want to ‘un-normalise’ the input vector - there are more mathematically ‘correct’ ways of doing this (using actual trig functions), but we can also just abuse some trigonometric relationships to get to that point;

private void GetLookInput(Vector2 axis)
{
    //Normalising the vector will return a point on the circumference of a unit circle in the same direction as the vector
    Vector2 dir = axis.normalized;
    //We can then abuse the properties of this circle mapping to remap the points onto the edge of a unit square (basically just scaling the circular vector until it hits an edge of the square) and finally scale our original vector by this same weight
    inputDirection = axis / Mathf.Max (Mathf.Abs (dir.x), Mathf.Abs (dir.y), Mathf.Epsilon);
}

Untested, but to my tired brain that looks about right.