UnityEditor.RectangleTool.ToolCoordToPosition C# (CSharp) Method

ToolCoordToPosition() public method

public ToolCoordToPosition ( ToolCoord coord, Bounds bounds ) : Vector2
coord ToolCoord
bounds UnityEngine.Bounds
return Vector2
        public Vector2 ToolCoordToPosition(ToolCoord coord, Bounds bounds)
        {
            switch (coord)
            {
                case ToolCoord.BottomLeft:
                    return bounds.min;

                case ToolCoord.Bottom:
                    return new Vector2(bounds.center.x, bounds.min.y);

                case ToolCoord.BottomRight:
                    return new Vector2(bounds.max.x, bounds.min.y);

                case ToolCoord.Left:
                    return new Vector2(bounds.min.x, bounds.center.y);

                case ToolCoord.Center:
                    return bounds.center;

                case ToolCoord.Right:
                    return new Vector2(bounds.max.x, bounds.center.y);

                case ToolCoord.TopLeft:
                    return new Vector2(bounds.min.x, bounds.max.y);

                case ToolCoord.Top:
                    return new Vector2(bounds.center.x, bounds.max.y);

                case ToolCoord.TopRight:
                    return bounds.max;
            }
            return Vector2.zero;
        }