MonoGdx.Scene2D.UI.ScrollPane.OnPreviewTouchDown C# (CSharp) Method

OnPreviewTouchDown() protected method

protected OnPreviewTouchDown ( TouchEventArgs e ) : void
e TouchEventArgs
return void
        protected override void OnPreviewTouchDown(TouchEventArgs e)
        {
            try {
                if (_draggingPointer != -1)
                    return;
                if (e.Pointer == 0 && e.Button != 0)
                    return;
                Stage.SetScrollFocus(this);

                if (!_flickScroll)
                    ResetFade();

                if (_fadeAlpha == 0)
                    return;

                Vector2 position = e.GetPosition(this);

                if (IsScrollX && _hScrollBounds.Contains(position.X, position.Y)) {
                    e.Stopped = true;
                    ResetFade();
                    if (_hKnobBounds.Contains(position.X, position.Y)) {
                        _lastPoint = position;
                        _handlePosition = _hKnobBounds.X;
                        _touchScrollH = true;
                        _draggingPointer = e.Pointer;

                        e.Handled = true;
                        return;
                    }

                    SetScrollX(ScrollX + Math.Max(_areaWidth * .9f, MaxX * .1f) * (position.X < _hKnobBounds.X ? -1 : 1));
                    e.Handled = true;
                    return;
                }

                if (IsScrollY && _vScrollBounds.Contains(position.X, position.Y)) {
                    e.Stopped = true;
                    ResetFade();
                    if (_vKnobBounds.Contains(position.X, position.Y)) {
                        _lastPoint = position;
                        _handlePosition = _vKnobBounds.Y;
                        _touchScrollV = true;
                        _draggingPointer = e.Pointer;

                        e.Handled = true;
                        return;
                    }

                    SetScrollY(ScrollY + Math.Max(_areaHeight * .9f, MaxY * .1f) * (position.Y < _vKnobBounds.Y ? 1 : -1));
                    e.Handled = true;
                    return;
                }
            }
            finally {
                base.OnPreviewTouchDown(e);
            }
        }