UnityEditor.PreviewRenderUtility.GetScaleFactor C# (CSharp) Method

GetScaleFactor() public method

public GetScaleFactor ( float width, float height ) : float
width float
height float
return float
        public float GetScaleFactor(float width, float height)
        {
            float a = Mathf.Max(Mathf.Min((float) (width * 2f), (float) 1024f), width) / width;
            float b = Mathf.Max(Mathf.Min((float) (height * 2f), (float) 1024f), height) / height;
            return (Mathf.Min(a, b) * EditorGUIUtility.pixelsPerPoint);
        }