UnityEditor.GameView.SnapZoom C# (CSharp) Method

SnapZoom() private method

private SnapZoom ( float newZoom ) : void
newZoom float
return void
        private void SnapZoom(float newZoom)
        {
            float num = Mathf.Log10(newZoom);
            float num2 = Mathf.Log10(this.minScale);
            float num3 = Mathf.Log10(this.maxScale);
            float maxValue = float.MaxValue;
            if ((num > num2) && (num < num3))
            {
                for (int i = 1; i <= this.maxScale; i++)
                {
                    float num6 = (150f * Mathf.Abs((float) (num - Mathf.Log10((float) i)))) / (num3 - num2);
                    if ((num6 < 4f) && (num6 < maxValue))
                    {
                        newZoom = i;
                        maxValue = num6;
                    }
                }
            }
            Rect shownAreaInsideMargins = this.m_ZoomArea.shownAreaInsideMargins;
            Vector2 focalPoint = shownAreaInsideMargins.position + ((Vector2) (shownAreaInsideMargins.size * 0.5f));
            this.m_ZoomArea.SetScaleFocused(focalPoint, (Vector2) (Vector2.one * newZoom));
        }