public override RectangleF GetBoundingRectangle(BoundingRectangleType rectangleType) { float thresholdWidth = UCCanvas.GetThresholdWidth(); if (this.IsCompleteDraw || this.IsEditMode) { return(this.GetBoundingRectCommon(thresholdWidth)); } else { return(HitUtil.CircleBoundingRectangle(this.Center, this.Radius + thresholdWidth / 2)); } }
public bool ObjectInRectangle(RectangleF rectangle, bool anyPoint) { RectangleF rect = HitUtil.CircleBoundingRectangle(this.P1, UCCanvas.GetThresholdWidth(this.radius)); if (anyPoint) { UnitPoint lp1 = new UnitPoint(rectangle.Left, rectangle.Top); UnitPoint lp2 = new UnitPoint(rectangle.Left, rect.Bottom); if (HitUtil.CircleIntersectWithLine(this.P1, 3, lp1, lp2)) { return(true); } lp1 = new UnitPoint(rectangle.Left, rectangle.Bottom); lp2 = new UnitPoint(rectangle.Right, rectangle.Bottom); if (HitUtil.CircleIntersectWithLine(this.P1, 3, lp1, lp2)) { return(true); } lp1 = new UnitPoint(rectangle.Left, rectangle.Top); lp2 = new UnitPoint(rectangle.Right, rectangle.Top); if (HitUtil.CircleIntersectWithLine(this.P1, 3, lp1, lp2)) { return(true); } lp1 = new UnitPoint(rectangle.Left, rectangle.Top); lp2 = new UnitPoint(rectangle.Right, rectangle.Top); if (HitUtil.CircleIntersectWithLine(this.P1, 3, lp1, lp2)) { return(true); } lp1 = new UnitPoint(rectangle.Right, rectangle.Top); lp2 = new UnitPoint(rectangle.Right, rectangle.Bottom); if (HitUtil.CircleIntersectWithLine(this.P1, 3, lp1, lp2)) { return(true); } } return(rectangle.Contains(rect)); }
public RectangleF GetBoundingRectangle(BoundingRectangleType rectangleType) { RectangleF rect = HitUtil.CircleBoundingRectangle(this.P1, UCCanvas.GetThresholdWidth(this.radius)); return(rect); }