/// <summary>
 /// Gets the smallest rectangle that completely contains all segments of the figure.
 /// </summary>
 public XRect GetBoundingBox()
 {
   XRect rect = new XRect(StartPoint.X, StartPoint.Y, 0, 0);
   foreach (PathSegment segment in Segments)
     rect.Union(segment.GetBoundingBox());
   return rect;
 }
Beispiel #2
0
 /// <summary>
 /// Returns the intersection of a rectangle and a point.
 /// </summary>
 public static XRect Union(XRect rect, XPoint point)
 {
     rect.Union(new XRect(point, point));
     return(rect);
 }
Beispiel #3
0
 /// <summary>
 /// Returns the union of two rectangles.
 /// </summary>
 public static XRect Union(XRect rect1, XRect rect2)
 {
     rect1.Union(rect2);
     return(rect1);
 }
Beispiel #4
0
 /// <summary>
 /// Returns the intersection of a rectangle and a point.
 /// </summary>
 public static XRect Union(XRect rect, XPoint point)
 {
   rect.Union(new XRect(point, point));
   return rect;
 }
Beispiel #5
0
 /// <summary>
 /// Returns the union of two rectangles.
 /// </summary>
 public static XRect Union(XRect rect1, XRect rect2)
 {
   rect1.Union(rect2);
   return rect1;
 }