/// <summary> /// 检测一个点是否在这个Part内 /// </summary> /// <param name="point">相对于SnipPageDesigner坐标的一个坐标点</param> public bool HitTest(Point point) { ///edit by zhenghao at 2008-06-23 9:45 ///对已经选定的容器型part进行检测 if (Selected && IsBox) { int x = BoundsForDesigner.X + BoxIconXOffset; int y = BoundsForDesigner.Y + BoxIconYOffset; Rectangle _boxIconRect = new Rectangle(new Point(x, y), BoxIconSize); return(_boxIconRect.Contains(point) || BoundsForDesigner.Contains(point)); } ///Delete:return BoundsForDesignerDisplay.Contains(point); return(BoundsForDesigner.Contains(point)); }
/// <summary> /// 检测一个矩形是否与这个Part相交 /// </summary> /// <param name="point">相对于SnipPageDesigner坐标的一个矩形</param> public bool HitTest(Rectangle rect) { ///Delete:return BoundsForDesignerDisplay.IntersectsWith(rect); return(BoundsForDesigner.IntersectsWith(rect)); }