MinMaxScroller() public static method

public static MinMaxScroller ( Rect position, int id, float &value, float &size, float visualStart, float visualEnd, float startLimit, float endLimit, GUIStyle slider, GUIStyle thumb, GUIStyle leftButton, GUIStyle rightButton, bool horiz ) : void
position UnityEngine.Rect
id int
value float
size float
visualStart float
visualEnd float
startLimit float
endLimit float
slider UnityEngine.GUIStyle
thumb UnityEngine.GUIStyle
leftButton UnityEngine.GUIStyle
rightButton UnityEngine.GUIStyle
horiz bool
return void
示例#1
0
        private void SliderGUI()
        {
            if (!this.m_HSlider && !this.m_VSlider)
            {
                return;
            }
            Bounds  drawingBounds     = this.drawingBounds;
            Rect    areaInsideMargins = this.shownAreaInsideMargins;
            float   num1  = this.styles.sliderWidth - this.styles.visualSliderWidth;
            float   num2  = !this.vSlider || !this.hSlider ? 0.0f : num1;
            Vector2 scale = this.m_Scale;

            if (this.m_HSlider)
            {
                Rect  position = new Rect(this.drawRect.x + 1f, this.drawRect.yMax - num1, this.drawRect.width - num2, this.styles.sliderWidth);
                float width    = areaInsideMargins.width;
                float xMin     = areaInsideMargins.xMin;
                EditorGUIExt.MinMaxScroller(position, this.horizontalScrollbarID, ref xMin, ref width, drawingBounds.min.x, drawingBounds.max.x, float.NegativeInfinity, float.PositiveInfinity, this.styles.horizontalScrollbar, this.styles.horizontalMinMaxScrollbarThumb, this.styles.horizontalScrollbarLeftButton, this.styles.horizontalScrollbarRightButton, true);
                float num3 = xMin;
                float num4 = xMin + width;
                if ((double)num3 > (double)areaInsideMargins.xMin)
                {
                    num3 = Mathf.Min(num3, num4 - this.m_HScaleMin);
                }
                if ((double)num4 < (double)areaInsideMargins.xMax)
                {
                    num4 = Mathf.Max(num4, num3 + this.m_HScaleMin);
                }
                this.SetShownHRangeInsideMargins(num3, num4);
            }
            if (this.m_VSlider)
            {
                Rect  position = new Rect(this.drawRect.xMax - num1, this.drawRect.y, this.styles.sliderWidth, this.drawRect.height - num2);
                float height   = areaInsideMargins.height;
                float num3     = -areaInsideMargins.yMax;
                EditorGUIExt.MinMaxScroller(position, this.verticalScrollbarID, ref num3, ref height, -drawingBounds.max.y, -drawingBounds.min.y, float.NegativeInfinity, float.PositiveInfinity, this.styles.verticalScrollbar, this.styles.verticalMinMaxScrollbarThumb, this.styles.verticalScrollbarUpButton, this.styles.verticalScrollbarDownButton, false);
                float num4 = (float)-((double)num3 + (double)height);
                float num5 = -num3;
                if ((double)num4 > (double)areaInsideMargins.yMin)
                {
                    num4 = Mathf.Min(num4, num5 - this.m_VScaleMin);
                }
                if ((double)num5 < (double)areaInsideMargins.yMax)
                {
                    num5 = Mathf.Max(num5, num4 + this.m_VScaleMin);
                }
                this.SetShownVRangeInsideMargins(num4, num5);
            }
            if (!this.uniformScale)
            {
                return;
            }
            float   num6    = this.drawRect.width / this.drawRect.height;
            Vector2 vector2 = scale - this.m_Scale;

            this.m_Scale         -= new Vector2(-vector2.y * num6, -vector2.x / num6);
            this.m_Translation.x -= vector2.y / 2f;
            this.m_Translation.y -= vector2.x / 2f;
            this.EnforceScaleAndRange();
        }
示例#2
0
 private void SliderGUI()
 {
     if (this.m_HSlider || this.m_VSlider)
     {
         float   num;
         float   num2;
         Bounds  drawingBounds          = this.drawingBounds;
         Rect    shownAreaInsideMargins = this.shownAreaInsideMargins;
         float   num3  = this.styles.sliderWidth - this.styles.visualSliderWidth;
         float   num4  = (!this.vSlider || !this.hSlider) ? 0f : num3;
         Vector2 scale = this.m_Scale;
         if (this.m_HSlider)
         {
             Rect  position = new Rect(this.drawRect.x + 1f, this.drawRect.yMax - num3, this.drawRect.width - num4, this.styles.sliderWidth);
             float width    = shownAreaInsideMargins.width;
             float xMin     = shownAreaInsideMargins.xMin;
             EditorGUIExt.MinMaxScroller(position, this.horizontalScrollbarID, ref xMin, ref width, drawingBounds.min.x, drawingBounds.max.x, float.NegativeInfinity, float.PositiveInfinity, this.styles.horizontalScrollbar, this.styles.horizontalMinMaxScrollbarThumb, this.styles.horizontalScrollbarLeftButton, this.styles.horizontalScrollbarRightButton, true);
             num  = xMin;
             num2 = xMin + width;
             if (num > shownAreaInsideMargins.xMin)
             {
                 num = Mathf.Min(num, num2 - this.m_HScaleMin);
             }
             if (num2 < shownAreaInsideMargins.xMax)
             {
                 num2 = Mathf.Max(num2, num + this.m_HScaleMin);
             }
             this.SetShownHRangeInsideMargins(num, num2);
         }
         if (this.m_VSlider)
         {
             Rect  rect3  = new Rect(this.drawRect.xMax - num3, this.drawRect.y, this.styles.sliderWidth, this.drawRect.height - num4);
             float height = shownAreaInsideMargins.height;
             float num8   = -shownAreaInsideMargins.yMax;
             EditorGUIExt.MinMaxScroller(rect3, this.verticalScrollbarID, ref num8, ref height, -drawingBounds.max.y, -drawingBounds.min.y, float.NegativeInfinity, float.PositiveInfinity, this.styles.verticalScrollbar, this.styles.verticalMinMaxScrollbarThumb, this.styles.verticalScrollbarUpButton, this.styles.verticalScrollbarDownButton, false);
             num  = -(num8 + height);
             num2 = -num8;
             if (num > shownAreaInsideMargins.yMin)
             {
                 num = Mathf.Min(num, num2 - this.m_VScaleMin);
             }
             if (num2 < shownAreaInsideMargins.yMax)
             {
                 num2 = Mathf.Max(num2, num + this.m_VScaleMin);
             }
             this.SetShownVRangeInsideMargins(num, num2);
         }
         if (this.uniformScale)
         {
             float num9 = this.drawRect.width / this.drawRect.height;
             scale -= this.m_Scale;
             Vector2 vector2 = new Vector2(-scale.y * num9, -scale.x / num9);
             this.m_Scale         -= vector2;
             this.m_Translation.x -= scale.y / 2f;
             this.m_Translation.y -= scale.x / 2f;
             this.EnforceScaleAndRange();
         }
     }
 }
示例#3
0
        private void SliderGUI()
        {
            if (!this.m_HSlider && !this.m_VSlider)
            {
                return;
            }
            Bounds  drawingBounds          = this.drawingBounds;
            Rect    shownAreaInsideMargins = this.shownAreaInsideMargins;
            float   num  = this.styles.sliderWidth - this.styles.visualSliderWidth;
            float   num2 = (!this.vSlider || !this.hSlider) ? 0f : num;
            Vector2 a    = this.m_Scale;

            if (this.m_HSlider)
            {
                Rect  position = new Rect(this.drawRect.x + 1f, this.drawRect.yMax - num, this.drawRect.width - num2, this.styles.sliderWidth);
                float width    = shownAreaInsideMargins.width;
                float xMin     = shownAreaInsideMargins.xMin;
                EditorGUIExt.MinMaxScroller(position, this.horizontalScrollbarID, ref xMin, ref width, drawingBounds.min.x, drawingBounds.max.x, float.NegativeInfinity, float.PositiveInfinity, this.styles.horizontalScrollbar, this.styles.horizontalMinMaxScrollbarThumb, this.styles.horizontalScrollbarLeftButton, this.styles.horizontalScrollbarRightButton, true);
                float num3 = xMin;
                float num4 = xMin + width;
                if (num3 > shownAreaInsideMargins.xMin)
                {
                    num3 = Mathf.Min(num3, num4 - this.m_HScaleMin);
                }
                if (num4 < shownAreaInsideMargins.xMax)
                {
                    num4 = Mathf.Max(num4, num3 + this.m_HScaleMin);
                }
                this.SetShownHRangeInsideMargins(num3, num4);
            }
            if (this.m_VSlider)
            {
                Rect  position2 = new Rect(this.drawRect.xMax - num, this.drawRect.y, this.styles.sliderWidth, this.drawRect.height - num2);
                float height    = shownAreaInsideMargins.height;
                float num5      = -shownAreaInsideMargins.yMax;
                EditorGUIExt.MinMaxScroller(position2, this.verticalScrollbarID, ref num5, ref height, -drawingBounds.max.y, -drawingBounds.min.y, float.NegativeInfinity, float.PositiveInfinity, this.styles.verticalScrollbar, this.styles.verticalMinMaxScrollbarThumb, this.styles.verticalScrollbarUpButton, this.styles.verticalScrollbarDownButton, false);
                float num3 = -(num5 + height);
                float num4 = -num5;
                if (num3 > shownAreaInsideMargins.yMin)
                {
                    num3 = Mathf.Min(num3, num4 - this.m_VScaleMin);
                }
                if (num4 < shownAreaInsideMargins.yMax)
                {
                    num4 = Mathf.Max(num4, num3 + this.m_VScaleMin);
                }
                this.SetShownVRangeInsideMargins(num3, num4);
            }
            if (this.uniformScale)
            {
                float num6 = this.drawRect.width / this.drawRect.height;
                a -= this.m_Scale;
                Vector2 b = new Vector2(-a.y * num6, -a.x / num6);
                this.m_Scale        -= b;
                this.m_Translation.x = this.m_Translation.x - a.y / 2f;
                this.m_Translation.y = this.m_Translation.y - a.x / 2f;
                this.EnforceScaleAndRange();
            }
        }
        void SliderGUI()
        {
            if (!m_HSlider && !m_VSlider)
            {
                return;
            }

            using (new EditorGUI.DisabledScope(!enableMouseInput))
            {
                Bounds editorBounds = drawingBounds;
                Rect   area = shownAreaInsideMargins;
                float  min, max;
                float  inset      = styles.sliderWidth - styles.visualSliderWidth;
                float  otherInset = (vSlider && hSlider) ? inset : 0;

                Vector2 scaleDelta = m_Scale;
                // Horizontal range slider
                if (m_HSlider)
                {
                    Rect  hRangeSliderRect = new Rect(drawRect.x + 1, drawRect.yMax - inset, drawRect.width - otherInset, styles.sliderWidth);
                    float shownXRange      = area.width;
                    float shownXMin        = area.xMin;
                    if (allowSliderZoomHorizontal)
                    {
                        EditorGUIExt.MinMaxScroller(hRangeSliderRect, horizontalScrollbarID,
                                                    ref shownXMin, ref shownXRange,
                                                    editorBounds.min.x, editorBounds.max.x,
                                                    Mathf.NegativeInfinity, Mathf.Infinity,
                                                    styles.horizontalScrollbar, styles.horizontalMinMaxScrollbarThumb,
                                                    styles.horizontalScrollbarLeftButton, styles.horizontalScrollbarRightButton, true);
                    }
                    else
                    {
                        shownXMin = GUI.Scroller(hRangeSliderRect,
                                                 shownXMin, shownXRange, editorBounds.min.x, editorBounds.max.x,
                                                 styles.horizontalScrollbar, styles.horizontalMinMaxScrollbarThumb,
                                                 styles.horizontalScrollbarLeftButton, styles.horizontalScrollbarRightButton, true);
                    }
                    min = shownXMin;
                    max = shownXMin + shownXRange;
                    if (min > area.xMin)
                    {
                        min = Mathf.Min(min, max - rect.width / m_HScaleMax);
                    }
                    if (max < area.xMax)
                    {
                        max = Mathf.Max(max, min + rect.width / m_HScaleMax);
                    }
                    SetShownHRangeInsideMargins(min, max);
                }

                // Vertical range slider
                // Reverse y values since y increses upwards for the draw area but downwards for the slider
                if (m_VSlider)
                {
                    if (m_UpDirection == YDirection.Positive)
                    {
                        Rect  vRangeSliderRect = new Rect(drawRect.xMax - inset, drawRect.y, styles.sliderWidth, drawRect.height - otherInset);
                        float shownYRange      = area.height;
                        float shownYMin        = -area.yMax;
                        if (allowSliderZoomVertical)
                        {
                            EditorGUIExt.MinMaxScroller(vRangeSliderRect, verticalScrollbarID,
                                                        ref shownYMin, ref shownYRange,
                                                        -editorBounds.max.y, -editorBounds.min.y,
                                                        Mathf.NegativeInfinity, Mathf.Infinity,
                                                        styles.verticalScrollbar, styles.verticalMinMaxScrollbarThumb,
                                                        styles.verticalScrollbarUpButton, styles.verticalScrollbarDownButton, false);
                        }
                        else
                        {
                            shownYMin = GUI.Scroller(vRangeSliderRect,
                                                     shownYMin, shownYRange, -editorBounds.max.y, -editorBounds.min.y,
                                                     styles.verticalScrollbar, styles.verticalMinMaxScrollbarThumb,
                                                     styles.verticalScrollbarUpButton, styles.verticalScrollbarDownButton, false);
                        }
                        min = -(shownYMin + shownYRange);
                        max = -shownYMin;
                        if (min > area.yMin)
                        {
                            min = Mathf.Min(min, max - rect.height / m_VScaleMax);
                        }
                        if (max < area.yMax)
                        {
                            max = Mathf.Max(max, min + rect.height / m_VScaleMax);
                        }
                        SetShownVRangeInsideMargins(min, max);
                    }
                    else
                    {
                        Rect  vRangeSliderRect = new Rect(drawRect.xMax - inset, drawRect.y, styles.sliderWidth, drawRect.height - otherInset);
                        float shownYRange      = area.height;
                        float shownYMin        = area.yMin;
                        if (allowSliderZoomVertical)
                        {
                            EditorGUIExt.MinMaxScroller(vRangeSliderRect, verticalScrollbarID,
                                                        ref shownYMin, ref shownYRange,
                                                        editorBounds.min.y, editorBounds.max.y,
                                                        Mathf.NegativeInfinity, Mathf.Infinity,
                                                        styles.verticalScrollbar, styles.verticalMinMaxScrollbarThumb,
                                                        styles.verticalScrollbarUpButton, styles.verticalScrollbarDownButton, false);
                        }
                        else
                        {
                            shownYMin = GUI.Scroller(vRangeSliderRect,
                                                     shownYMin, shownYRange, editorBounds.min.y, editorBounds.max.y,
                                                     styles.verticalScrollbar, styles.verticalMinMaxScrollbarThumb,
                                                     styles.verticalScrollbarUpButton, styles.verticalScrollbarDownButton, false);
                        }
                        min = shownYMin;
                        max = shownYMin + shownYRange;
                        if (min > area.yMin)
                        {
                            min = Mathf.Min(min, max - rect.height / m_VScaleMax);
                        }
                        if (max < area.yMax)
                        {
                            max = Mathf.Max(max, min + rect.height / m_VScaleMax);
                        }
                        SetShownVRangeInsideMargins(min, max);
                    }
                }

                if (uniformScale)
                {
                    float aspect = drawRect.width / drawRect.height;
                    scaleDelta -= m_Scale;
                    var delta = new Vector2(-scaleDelta.y * aspect, -scaleDelta.x / aspect);

                    m_Scale         -= delta;
                    m_Translation.x -= scaleDelta.y / 2;
                    m_Translation.y -= scaleDelta.x / 2;
                    EnforceScaleAndRange();
                }
            }
        }
示例#5
0
 private void SliderGUI()
 {
     if (this.m_HSlider || this.m_VSlider)
     {
         using (new EditorGUI.DisabledScope(!this.enableMouseInput))
         {
             Bounds  drawingBounds          = this.drawingBounds;
             Rect    shownAreaInsideMargins = this.shownAreaInsideMargins;
             float   num  = this.styles.sliderWidth - this.styles.visualSliderWidth;
             float   num2 = (!this.vSlider || !this.hSlider) ? 0f : num;
             Vector2 a    = this.m_Scale;
             if (this.m_HSlider)
             {
                 Rect  position = new Rect(this.drawRect.x + 1f, this.drawRect.yMax - num, this.drawRect.width - num2, this.styles.sliderWidth);
                 float width    = shownAreaInsideMargins.width;
                 float num3     = shownAreaInsideMargins.xMin;
                 if (this.m_EnableSliderZoom)
                 {
                     EditorGUIExt.MinMaxScroller(position, this.horizontalScrollbarID, ref num3, ref width, drawingBounds.min.x, drawingBounds.max.x, float.NegativeInfinity, float.PositiveInfinity, this.styles.horizontalScrollbar, this.styles.horizontalMinMaxScrollbarThumb, this.styles.horizontalScrollbarLeftButton, this.styles.horizontalScrollbarRightButton, true);
                 }
                 else
                 {
                     num3 = GUI.Scroller(position, num3, width, drawingBounds.min.x, drawingBounds.max.x, this.styles.horizontalScrollbar, this.styles.horizontalMinMaxScrollbarThumb, this.styles.horizontalScrollbarLeftButton, this.styles.horizontalScrollbarRightButton, true);
                 }
                 float num4 = num3;
                 float num5 = num3 + width;
                 if (num4 > shownAreaInsideMargins.xMin)
                 {
                     num4 = Mathf.Min(num4, num5 - this.rect.width / this.m_HScaleMax);
                 }
                 if (num5 < shownAreaInsideMargins.xMax)
                 {
                     num5 = Mathf.Max(num5, num4 + this.rect.width / this.m_HScaleMax);
                 }
                 this.SetShownHRangeInsideMargins(num4, num5);
             }
             if (this.m_VSlider)
             {
                 if (this.m_UpDirection == ZoomableArea.YDirection.Positive)
                 {
                     Rect  position2 = new Rect(this.drawRect.xMax - num, this.drawRect.y, this.styles.sliderWidth, this.drawRect.height - num2);
                     float height    = shownAreaInsideMargins.height;
                     float num6      = -shownAreaInsideMargins.yMax;
                     if (this.m_EnableSliderZoom)
                     {
                         EditorGUIExt.MinMaxScroller(position2, this.verticalScrollbarID, ref num6, ref height, -drawingBounds.max.y, -drawingBounds.min.y, float.NegativeInfinity, float.PositiveInfinity, this.styles.verticalScrollbar, this.styles.verticalMinMaxScrollbarThumb, this.styles.verticalScrollbarUpButton, this.styles.verticalScrollbarDownButton, false);
                     }
                     else
                     {
                         num6 = GUI.Scroller(position2, num6, height, -drawingBounds.max.y, -drawingBounds.min.y, this.styles.verticalScrollbar, this.styles.verticalMinMaxScrollbarThumb, this.styles.verticalScrollbarUpButton, this.styles.verticalScrollbarDownButton, false);
                     }
                     float num4 = -(num6 + height);
                     float num5 = -num6;
                     if (num4 > shownAreaInsideMargins.yMin)
                     {
                         num4 = Mathf.Min(num4, num5 - this.rect.height / this.m_VScaleMax);
                     }
                     if (num5 < shownAreaInsideMargins.yMax)
                     {
                         num5 = Mathf.Max(num5, num4 + this.rect.height / this.m_VScaleMax);
                     }
                     this.SetShownVRangeInsideMargins(num4, num5);
                 }
                 else
                 {
                     Rect  position3 = new Rect(this.drawRect.xMax - num, this.drawRect.y, this.styles.sliderWidth, this.drawRect.height - num2);
                     float height2   = shownAreaInsideMargins.height;
                     float num7      = shownAreaInsideMargins.yMin;
                     if (this.m_EnableSliderZoom)
                     {
                         EditorGUIExt.MinMaxScroller(position3, this.verticalScrollbarID, ref num7, ref height2, drawingBounds.min.y, drawingBounds.max.y, float.NegativeInfinity, float.PositiveInfinity, this.styles.verticalScrollbar, this.styles.verticalMinMaxScrollbarThumb, this.styles.verticalScrollbarUpButton, this.styles.verticalScrollbarDownButton, false);
                     }
                     else
                     {
                         num7 = GUI.Scroller(position3, num7, height2, drawingBounds.min.y, drawingBounds.max.y, this.styles.verticalScrollbar, this.styles.verticalMinMaxScrollbarThumb, this.styles.verticalScrollbarUpButton, this.styles.verticalScrollbarDownButton, false);
                     }
                     float num4 = num7;
                     float num5 = num7 + height2;
                     if (num4 > shownAreaInsideMargins.yMin)
                     {
                         num4 = Mathf.Min(num4, num5 - this.rect.height / this.m_VScaleMax);
                     }
                     if (num5 < shownAreaInsideMargins.yMax)
                     {
                         num5 = Mathf.Max(num5, num4 + this.rect.height / this.m_VScaleMax);
                     }
                     this.SetShownVRangeInsideMargins(num4, num5);
                 }
             }
             if (this.uniformScale)
             {
                 float num8 = this.drawRect.width / this.drawRect.height;
                 a -= this.m_Scale;
                 Vector2 b = new Vector2(-a.y * num8, -a.x / num8);
                 this.m_Scale        -= b;
                 this.m_Translation.x = this.m_Translation.x - a.y / 2f;
                 this.m_Translation.y = this.m_Translation.y - a.x / 2f;
                 this.EnforceScaleAndRange();
             }
         }
     }
 }
示例#6
0
 private void SliderGUI()
 {
     if (this.m_HSlider || this.m_VSlider)
     {
         using (new EditorGUI.DisabledScope(!this.enableMouseInput))
         {
             float   num;
             float   num2;
             Bounds  drawingBounds          = this.drawingBounds;
             Rect    shownAreaInsideMargins = this.shownAreaInsideMargins;
             float   num3  = this.styles.sliderWidth - this.styles.visualSliderWidth;
             float   num4  = (!this.vSlider || !this.hSlider) ? 0f : num3;
             Vector2 scale = this.m_Scale;
             if (this.m_HSlider)
             {
                 Rect  position = new Rect(this.drawRect.x + 1f, this.drawRect.yMax - num3, this.drawRect.width - num4, this.styles.sliderWidth);
                 float width    = shownAreaInsideMargins.width;
                 float xMin     = shownAreaInsideMargins.xMin;
                 if (this.m_EnableSliderZoom)
                 {
                     EditorGUIExt.MinMaxScroller(position, this.horizontalScrollbarID, ref xMin, ref width, drawingBounds.min.x, drawingBounds.max.x, float.NegativeInfinity, float.PositiveInfinity, this.styles.horizontalScrollbar, this.styles.horizontalMinMaxScrollbarThumb, this.styles.horizontalScrollbarLeftButton, this.styles.horizontalScrollbarRightButton, true);
                 }
                 else
                 {
                     xMin = GUI.Scroller(position, xMin, width, drawingBounds.min.x, drawingBounds.max.x, this.styles.horizontalScrollbar, this.styles.horizontalMinMaxScrollbarThumb, this.styles.horizontalScrollbarLeftButton, this.styles.horizontalScrollbarRightButton, true);
                 }
                 num  = xMin;
                 num2 = xMin + width;
                 if (num > shownAreaInsideMargins.xMin)
                 {
                     num = Mathf.Min(num, num2 - (this.rect.width / this.m_HScaleMax));
                 }
                 if (num2 < shownAreaInsideMargins.xMax)
                 {
                     num2 = Mathf.Max(num2, num + (this.rect.width / this.m_HScaleMax));
                 }
                 this.SetShownHRangeInsideMargins(num, num2);
             }
             if (this.m_VSlider)
             {
                 if (this.m_UpDirection == YDirection.Positive)
                 {
                     Rect  rect8  = new Rect(this.drawRect.xMax - num3, this.drawRect.y, this.styles.sliderWidth, this.drawRect.height - num4);
                     float height = shownAreaInsideMargins.height;
                     float num8   = -shownAreaInsideMargins.yMax;
                     if (this.m_EnableSliderZoom)
                     {
                         EditorGUIExt.MinMaxScroller(rect8, this.verticalScrollbarID, ref num8, ref height, -drawingBounds.max.y, -drawingBounds.min.y, float.NegativeInfinity, float.PositiveInfinity, this.styles.verticalScrollbar, this.styles.verticalMinMaxScrollbarThumb, this.styles.verticalScrollbarUpButton, this.styles.verticalScrollbarDownButton, false);
                     }
                     else
                     {
                         num8 = GUI.Scroller(rect8, num8, height, -drawingBounds.max.y, -drawingBounds.min.y, this.styles.verticalScrollbar, this.styles.verticalMinMaxScrollbarThumb, this.styles.verticalScrollbarUpButton, this.styles.verticalScrollbarDownButton, false);
                     }
                     num  = -(num8 + height);
                     num2 = -num8;
                     if (num > shownAreaInsideMargins.yMin)
                     {
                         num = Mathf.Min(num, num2 - (this.rect.height / this.m_VScaleMax));
                     }
                     if (num2 < shownAreaInsideMargins.yMax)
                     {
                         num2 = Mathf.Max(num2, num + (this.rect.height / this.m_VScaleMax));
                     }
                     this.SetShownVRangeInsideMargins(num, num2);
                 }
                 else
                 {
                     Rect  rect14 = new Rect(this.drawRect.xMax - num3, this.drawRect.y, this.styles.sliderWidth, this.drawRect.height - num4);
                     float size   = shownAreaInsideMargins.height;
                     float yMin   = shownAreaInsideMargins.yMin;
                     if (this.m_EnableSliderZoom)
                     {
                         EditorGUIExt.MinMaxScroller(rect14, this.verticalScrollbarID, ref yMin, ref size, drawingBounds.min.y, drawingBounds.max.y, float.NegativeInfinity, float.PositiveInfinity, this.styles.verticalScrollbar, this.styles.verticalMinMaxScrollbarThumb, this.styles.verticalScrollbarUpButton, this.styles.verticalScrollbarDownButton, false);
                     }
                     else
                     {
                         yMin = GUI.Scroller(rect14, yMin, size, drawingBounds.min.y, drawingBounds.max.y, this.styles.verticalScrollbar, this.styles.verticalMinMaxScrollbarThumb, this.styles.verticalScrollbarUpButton, this.styles.verticalScrollbarDownButton, false);
                     }
                     num  = yMin;
                     num2 = yMin + size;
                     if (num > shownAreaInsideMargins.yMin)
                     {
                         num = Mathf.Min(num, num2 - (this.rect.height / this.m_VScaleMax));
                     }
                     if (num2 < shownAreaInsideMargins.yMax)
                     {
                         num2 = Mathf.Max(num2, num + (this.rect.height / this.m_VScaleMax));
                     }
                     this.SetShownVRangeInsideMargins(num, num2);
                 }
             }
             if (this.uniformScale)
             {
                 float num11 = this.drawRect.width / this.drawRect.height;
                 scale -= this.m_Scale;
                 Vector2 vector14 = new Vector2(-scale.y * num11, -scale.x / num11);
                 this.m_Scale         -= vector14;
                 this.m_Translation.x -= scale.y / 2f;
                 this.m_Translation.y -= scale.x / 2f;
                 this.EnforceScaleAndRange();
             }
         }
     }
 }