bool IClickable.Contains(Point pt) { if (DisplayRect.Contains(pt)) { float direction; if (orientation == ArrowOrientation.Right) { Point origin = new Point(DisplayRect.Right, DisplayRect.Top + DisplayRect.Height / 2); Point bottomCorner = new Point(DisplayRect.Left - origin.X, DisplayRect.Bottom - origin.Y); pt.X -= origin.X; pt.Y -= origin.Y; direction = (float)bottomCorner.Y / bottomCorner.X; } else { Point origin = new Point(DisplayRect.Left, DisplayRect.Top + DisplayRect.Height / 2); Point bottomCorner = new Point(DisplayRect.Right - origin.X, DisplayRect.Bottom - origin.Y); pt.X -= origin.X; pt.Y -= origin.Y; direction = (float)bottomCorner.Y / bottomCorner.X; } return(pt.Y <= (int)(pt.X * direction) && pt.Y >= -(int)(pt.X * direction)); } return(false); }
/// <summary> /// returns true is control contains point /// </summary> /// <param name = "pt"></param> /// point coordinates that include scrollbar offset /// <returns></returns> internal bool Contains(Point pt) { if (_lg is Line) { return(((Line)_lg).Contains(pt)); } return(DisplayRect.Contains(pt)); }
bool IClickable.Contains(Point pt) { return(DisplayRect.Contains(pt)); }