protected void update_scroll_offset()
        {
            // come up with a better name for this method //Debug
            int target_y = this.RowSize * Scroll;

            if (Math.Abs(Offset.Y - target_y) <= this.RowSize / 4)
            {
                Offset.Y = target_y;
            }
            if (Math.Abs(Offset.Y - target_y) <= this.RowSize)
            {
                Offset.Y = Additional_Math.int_closer((int)Offset.Y, target_y, this.RowSize / 4);
            }
            else
            {
                Offset.Y = ((int)(Offset.Y + target_y)) / 2;
            }

            if (Offset.Y != target_y && Scrollbar != null)
            {
                if (Offset.Y > target_y)
                {
                    Scrollbar.moving_up();
                }
                else
                {
                    Scrollbar.moving_down();
                }
            }
        }
Esempio n. 2
0
        protected void update_scroll_offset()
        {
            int target_y = 16 * Scroll;

            if (!ManualScroll)
            {
                if (Math.Abs(Offset.Y - target_y) <= 16 / 4)
                {
                    Offset.Y = target_y;
                }
                if (Math.Abs(Offset.Y - target_y) <= 16)
                {
                    Offset.Y = Additional_Math.int_closer((int)Offset.Y, target_y, 16 / 4);
                }
                else
                {
                    Offset.Y = ((int)(Offset.Y + target_y)) / 2;
                }
            }

            if (Offset.Y != target_y && Scrollbar != null)
            {
                if (Offset.Y > target_y)
                {
                    Scrollbar.moving_up();
                }
                else
                {
                    Scrollbar.moving_down();
                }
            }
        }