LayoutFarm.CustomWidgets.EaseBox.OnMouseWheel C# (CSharp) Method

OnMouseWheel() protected method

protected OnMouseWheel ( UIMouseEventArgs e ) : void
e LayoutFarm.UI.UIMouseEventArgs
return void
        protected override void OnMouseWheel(UIMouseEventArgs e)
        {
            //vertical scroll
            if (this.desiredHeight > this.Height)
            {
                if (e.Delta < 0)
                {
                    //down
                    this.viewportY += 20;
                    if (viewportY > desiredHeight - this.Height)
                    {
                        this.viewportY = desiredHeight - this.Height;
                    }
                }
                else
                {
                    //up
                    this.viewportY -= 20;
                    if (viewportY < 0)
                    {
                        viewportY = 0;
                    }
                }
                this.primElement.SetViewport(viewportX, viewportY);
                this.InvalidateGraphics();
            }
        }
        //-------------------