Exemplo n.º 1
0
        public Point RePoint(GraphicsBase g)
        {
            if (this.FontSizeF == SizeF.Empty)
            {
                this.FontSizeF = g.MeasureString(this.Content, this.Font);
            }
            int offset = (int)((DateTime.Now - LastDrawTime).TotalMilliseconds / this.ScrollDelay) + 1;
            int x      = (int)(LastPoint.X - ((Direction == Direction.Left) ? offset : 0));
            int y      = (int)(LastPoint.Y - ((Direction == Direction.Down) ? offset : 0));

            if (x + this.FontSizeF.Width < this.Location.X)
            {
                x = this.Location.X + this.Size.Width;
            }
            if (y + this.FontSizeF.Height < this.Location.X)
            {
                y = this.Location.Y + this.Size.Height;
            }
            return(new Point(x, y));
        }