/// <summary> /// 判断指定点是否在绘图对象中 /// </summary> /// <param name="canvas"></param> /// <param name="point"></param> /// <returns></returns> public virtual bool PointInObject(ICanvas canvas, UnitPoint point) { RectangleF boundingrect = GetBoundingRect(canvas); if (boundingrect.Contains(point.Point) == false) { return(false); } float thWidth = Line.ThresholdWidth(canvas, Width, ThresholdPixel); if (HitUtil.PointInPoint(m_center, point, thWidth)) { return(true); } return(HitUtil.IsPointInCircle(m_center, m_radius, point, thWidth / 2)); }
public bool PointInObject(UnitPoint unitPoint) { RectangleF rectangleF = this.GetBoundingRectangle(BoundingRectangleType.All); if (rectangleF.Contains(unitPoint.Point) == false) { return(false); } float thresholdWidth = UCCanvas.GetThresholdWidth(); if (HitUtil.PointInPoint(this.P1, unitPoint, thresholdWidth)) { return(true); } return(HitUtil.IsPointInCircle(this.P1, this.radius, unitPoint, thresholdWidth / 2)); }