Question about DrawLine

Hello everyone,
I’ve got this problem with Draw line.

1377393--69824--$fV8MmyE.png

The width is off but the height is fine. The blue dot is the middle of the screen and the red is the mouse position. Any ideas?

public Vector2 middleOfScreen;
    
// Use this for initialization
void Start () {
    middleOfScreen = new Vector2(Screen.width / 2, Screen.height / 2);
}
    	
void OnGUI() {
    Drawing.DrawLine(new Vector2(Event.current.mousePosition.x, Event.current.mousePosition.y), middleOfScreen);
}

Thanks for the help aswell.

If you mean Debug.DrawLine, it takes coordinates in world space, not in screen space.

Camera.main.ScreenToWorldPoint(…) should help.