public override Rect GetBounds(ref Point start) { var centre = GetCentre(ref start); var angle = GetAngle(ref start); if (Comparators.InIntervalDown(start.X, EndPoint.X, centre.X) && Comparators.InIntervalDown(start.Y, EndPoint.Y, centre.Y)) { if (angle < 180) { return(new Rect(start, EndPoint)); } ////else ////{ //// var r = GetRadius(ref start); //// return new Rect(centre.X - r, centre.Y - r, 2 * r, 2 * r); ////} } var min = new Point(double.PositiveInfinity, double.PositiveInfinity); var max = new Point(double.NegativeInfinity, double.NegativeInfinity); CheckMinMax(ref start, ref min, ref max); Point ep = EndPoint; CheckMinMax(ref ep, ref min, ref max); double a = 5; angle = Math.Abs(angle); if (a < angle) { int numberOfTiles = (int)Math.Ceiling(angle / a); double rel = a / angle; for (int i = 1; i < numberOfTiles; ++i) { var pt = GetPointOnSegment(ref start, i * rel); CheckMinMax(ref pt, ref min, ref max); } } return(new Rect(min, max)); }