ComponentFactory.Krypton.Ribbon.ViewLayoutRibbonGalleryItems.OnScrollTick C# (CSharp) Method

OnScrollTick() private method

private OnScrollTick ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private void OnScrollTick(object sender, EventArgs e)
        {
            // Update the offset by scroll move amount
            if (_offset != 0)
            {
                if (_offset > 0)
                    _offset = Math.Max(0, _offset - SCROLL_MOVE);
                else
                    _offset = Math.Min(0, _offset + SCROLL_MOVE);
            }

            // If we have finished the scrolling
            if (_offset == 0)
            {
                _beginLine = -1;
                _scrollTimer.Stop();
            }

            // Need to repaint to show changes
            _needPaint(this, new NeedLayoutEventArgs(true));
        }