UnityEditor.SpriteEditorWindow.ClampSpriteBorder C# (CSharp) Method

ClampSpriteBorder() private method

private ClampSpriteBorder ( Vector4 border ) : Vector4
border Vector4
return Vector4
        private Vector4 ClampSpriteBorder(Vector4 border)
        {
            Rect rect = this.FlipNegativeRect(this.selected.m_Rect);
            float width = rect.width;
            float height = rect.height;
            return new Vector4 { x = Mathf.RoundToInt(Mathf.Clamp(border.x, 0f, Mathf.Min(width - border.z, width))), z = Mathf.RoundToInt(Mathf.Clamp(border.z, 0f, Mathf.Min(width - border.x, width))), y = Mathf.RoundToInt(Mathf.Clamp(border.y, 0f, Mathf.Min(height - border.w, height))), w = Mathf.RoundToInt(Mathf.Clamp(border.w, 0f, Mathf.Min(height - border.y, height))) };
        }